masijade 1,351 Industrious Poster Team Colleague Featured Poster

> javaAddict had the write idea

Write? ;-)

Yep. He rote write. ;-)

(He wrote right, of course.)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

javaAddict had the write idea, unfortunately, your variables are doubles, so you can't simply cast the division operations to ints. You can, however, do this in the print statements.

I.E.

System.out.println("Enter purchase amount: " + purchase);
System.out.println("The change is: " + change);
System.out.println("The number of quarters is: " + (int) quarters);
System.out.println("The number of dimes is: " + (int) dimes);
System.out.println("The number of nickels is: " + (int) nickels);
System.out.println("The number of pennies is: " + (int) pennies);

Edit: The better solution, however, is javaAddicts, combined with you changing the quarters, dimes, nickels, and pennies to ints, rather than doubles.

Edit Again: And I see, he mentioned that also, you seemingly, simply didn't do it. Try javaAddicts solution, and if it doesn't work, post your modified code here with the errors.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Change

String year = request.getParameter("xyear");

to

String year = request.getParameter("xyear");
if (year == null) {
  year = today.getYear();
}

But you also really need to change "today" to be Calendar and use get(Calendar.YEAR) instead of getYear(), as the getYear() method of Date is deprecated for a reason. See the API for Calendar.

Edit: Also, you really should not be using scriptlets in a JSP. What you're doing here can be handled by a simple bean and a couple of standard JSTL tags.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

8Gb RAM
windows XP (Vista is too crappy for gaming)

Can XP handle 8 Gb RAM?

I haven't looked at the specs, but I have at least heard (I can't comment on the reliability of the source) that it can't handle more than 2Gb.

Edit: Sorry make that 4, but effectively only about 3.5.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Yes, you've added a constructor, but have you, anywhere in your code, called

attr[i] = new attribute();
masijade 1,351 Industrious Poster Team Colleague Featured Poster

An "application" does not have an "instance id". It has a "process id" though. If that is what you mean then you will have to use Runtime.exec() to set of a "ps" command (or the OS specific equivalent as ps is a Unix/Linx command).

IOW, this is not the sort of thing Java was meant for. (As you've been told before.)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You've declarred an array (attr) of type attrribute, but the elements of that array, until defined, are null. So, when you attempt to dereference one of those elements (that are currently null) by referencing the "name" attribute you get an NPE. You need to define each element in the array with new attribute() (or whatever constructor you use).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

There would be, if we knew what you were talking about.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Yes, but the Rocky Horror Picture Show is, at least, funny. That's just scary, and, maybe, a little sad. ;-)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Go through the JDBC tutorials, then go through the Swing tutorials, then, make sure you don't mix the two into the same class.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

> Have you tried this site: http://www.roseindia.net/jsp/jsp.htm
I wouldn't trust that site. The content seems to be substandard.

That's an understatement!

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Then again, with JNI you could, but it wouldn't b worth the effort.

And you got the response you did, because of the question you asked, which was basically "do this for me".

I'll tell you right now though, you would be much better off first learning JSP (and Java) in general (at least the basics), and how to do it right (i.e. in JSP no scriplets) then you are simply diving in by attempting to convert a PSP script to a Java program. JSP, and Java in general, is many times more flexible, and so, in many ways, many times more complicated than PSP. They do not equate 1 to 1, they operate completely differently.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Because you don't.

Read the JDBC Tutorial.

Edit: And don't use scriptlets in the thing in the first place. Put all DB stuff in one, or more, beans.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

? WTF ?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Use a bean, as it is suppossed to be done.

You shouldn't have any scriptlets in your code anyway, so having to duplicate the code over and over again shouldn't be a problem in the first place.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I don't know what I was thinking of, I meant Long, of course. ;-)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

? Wtf ?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

A while loop.

Edit: Or a for loop ;-)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

First, this is two years old, I doubt he's waiting any more. Second, don't forget that then the separator is also selectable and that he will have to add some hooks to either prevent it's selection actually doing anything, or better yet that it can't be selected at all, and then you're right back to about the same amount of work as the other possibilty.

masijade 1,351 Industrious Poster Team Colleague Featured Poster
Float.parseFloat(String value, int radix);

See the API docs.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I really don't know how that is going to help you. Even if the information is correct "HP/UX 10.01", "Linux", "OS/2 TCP/IP 3.0", and "VMS/Multinet" all have the same values. So, when you see those values, which one is it? And that's if the system even answers a ping. In many environments, all unneccessary network protocols (and that includes answering pings) are "shut off".

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Yes, we can. Will we? No. We are not here to do your work for you.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

So add a method to the object that will allow you to compare it with another value.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Loop through the vector comparing the "empcodes" contained in the contained objects then delete the matching one.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Already done in Sun forums, but I'll do it again here.

The compiler will automatically create a default constructor for your class, but only if you don't declare any constructors at all.

Whenever a constructor is called, if that contructor does not contain a call to a specific super class class constructor, then the compiler will automatically add a call to the default constructor of the super class.

Since you created a constructor in EmpData, it has no default constructor.

Since VectorHandler has no constructor, the compiler creates a default constructor, which calls the default constructor of the super class (EmpData). That constructor does not exist, however.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Simply add

EmpData() {}

to your EmpData class for the first error.

For the second error, you are not using Generics and are using JDK 1.5 or later. It's a warning (a note) and it won't stop you compiling the program, but you really should read up on Generics (check out the "New Features" portion of the API docs for JDK 1.5) and use them.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Look at this (from an earlier attempt of yours which is almost right):

//ED e = new ED();
//e = (e)vect.elementAt(0);

Is the item stored in the vector of type "e", or of type "ED", because the type is what you need to cast to, not the variable.

You should, of course, also place this in a loop using the loop counter rather than 0. Then again, you could use the new for loop and not worry about casting or the counter.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You should also be able to enter \*foo \*bar on the command line.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Use a filter and write the produced html to both the output stream and to JavaMail.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

This is the Java, not JavaScript, forum. You see the difference there?

Next time, post in the JavaScript forum, please.

I have already requested th admins move this thread.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

We are not going to do it for you, so if you want some help, you'd better post what you have so far, describe what the current problem with itis, provide all error messages completely, and ask a specific question.

Edit: BTW, https is a protocol that additionally makes use of ssl, it is not a "format".

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Assuming you mean the v23.9 directly after the -p argument

sed -e 's;/v23.9/;/abcde/;g' file1.txt > file2.txt

If you mean after the -p and after -l arguments then

sed -e 's;/v23.9;/abcde;g' file1.txt > file2.txt
masijade 1,351 Industrious Poster Team Colleague Featured Poster
DIR=`(cd ../../MIS/LANDING;pwd)`
find ${DIR} -name MIS_Customer_\*
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Close the IO channel.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Like I say, you need to talk to the admins.

Also, you mistakenly provided m0lf3tt4 in an earlier post, so I would suggest getting your password changed.

Also, this DB code should not be included in a jsp as a scriptlet. It should be placed in a bean. Also, since this seems to be something that takes action, rather than simply presenting data, it should be done by a servlet, not a JSP.

Actions are handled by servlets, data is handled by beans (and other classes outside of the JSP/Servlet classes), and JSP is for the presentation.

MVC

Model -- The Data. "External" objects such as Beans
View -- The Presentation. The delivery of the actual HTML. JSP
Control -- Essentially performing action requested by the user. Servlet.

Edit:

The sql stuff should also take place in a try block with the close lines being placed in the finally block, otherwise, you will leave behind open connections with this code and will soon run out.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

no...i'use only this string :

[TEX]conn = DriverManager.getConnection("jdbc:oracle:thin://PC280631275888:1521:XE"[/TEX].

scuse me for the emoticons but i'dont know how to format the text..but is XE
i've read that seems to use orcl and not XE but i don't know where...!!!in the tnsnames.ora and listener.ora SID name are all = XE!!!

Then, I can only say that you need to get the Oracle admins to check it out.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Surround your code (and the conn line from above) with code tags. i.e.

[code]SID[/code]

will appear as

SID
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Is this the url you're using

jdbc:oracle:thin://PC280631275888:1521:XE

Since you're not using code tags, I can't tell because you keep getting a "smilely" I don't recognise.

Seemingly, though, according to the error message

The Connection descriptor used by the client was:
localhost:1521:orcl

you are using:

jdbc:oracle:thin://localhost:1521:orcl

Maybe in another place in the code, or something?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

A thread start another thread. The thread that was started has a variable (generally a boolean) that is either protected/public or a setter is provided for it. The class also uses a while loop with that boolean as the test. As soon as the boolean is set to false by the first thread, the next time the second thread checks the value the while loop is done and the thread can exit.

That is only one the ways to do it, but it is one of the more common ways for simple threads.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Make sure it is actually the thin driver that you have, and not the oci driver. My first response was incorrect, ClassNotFound is classpath, no suitable driver is a misspelled url, or you have the oci driver installed rather than the thin driver.

Also, I don't believe you want username@hostname, but rather just hostname. i.e.

jdbc:oracle:thin://locahost:1521:dbName

Read the documentation for the driver you do have for the proper url.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Place the Oracle Driver jar into tomcats common/lib directory.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

An ArrayList "doesn't care" how long it is. It is dynamic.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

No, we won't write it for you. That is not helping you. You don't learn anything that way. And, if you're not going to learn anything, there is no need to take the class, and you definately should not pass it, if you don't learn anything.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What does printList() do?

From that error messages, and the rest you've said about it, I can only assume that it has a return type void, and that it makes calls to System.out.println() itself, to produce the output.

Well, you can't do it that way. Have the method simply build a String (rather than outputting it directly) and then return that String from the method. Then it should "work" in both instances.

If all that is the case, then I need to ask how you thought that something was being output directly to the standard output stream would show up in the JOptionPane? Did you think it would happen simply because you placed the call to the method inside of a call to JOptionPane?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

This is probably only the first thing (I haven't looked very close), but, from the following two lines, remove the semi-colon from the first, and move the second to a line before the first.

public static void main(String[]args);
    private static Random random = new Random();

Edit: As far as what to put in there, think about it. What does the program need to do, then insert those steps.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

He/She wishes!

iamthwee commented: Ho ho ho +13
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Of course it's possible to execute remote applications. Always has been. If its a Unix environment then I would suggest using JSch (for ssh protocol) and execute the application on the server to be used on the client. But considering your talking about Windoof, there are such things as network applications, but they are normally triggered locally, over shared filesystems and the like. But, if you have a true client/server (not web server/browser) there is no reason that the "directions" can't come from the "server", delivered through the client.

Start writing something, and when you have a problem, and a specific question, then come back and ask. I can tell you though, inspect the DeskTop class.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

And I have told you often enough, not with any type of web application. Possibly/probably if you build your own Server and Client and perform the actions preferebly only on a Local Network, then maybe, but not as a Web Application, period, end of story.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Here we go again.

darkagn commented: lol, don't you just love this guy's persistence?? +1
masijade 1,351 Industrious Poster Team Colleague Featured Poster

He'll find plenty of free code for storing blobs, although, free code for a finger print scanner may be a bit harder to come by. Code for a standard scanner should be available though, as well as example code for other USB devices and serial comm port devices, so there are plenty of sources to get started with, he just needs to Google for some.