masijade 1,351 Industrious Poster Team Colleague Featured Poster

Okay? And what is actually happening? I know what you want, but you aren't telling what you actually have, and so I can't really help you get there from here, since I don't know where here is.

I can say, however, that if you expect the switch to loop, no. You need to use a while loop for that. (Note that this switch can be a part of that while loop, though).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

In what way it "doest seem to be working"? That switch looks just fine. Maybe include a break in the default case, though, just for completeness.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Bzzzzzzt! Gong!!!!! Wrong answer! We are not here to do your work for you.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Google first for some CSV utility library, then Google for some "rbnb server" (whatever that is) utility library, and write a program to use them.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

And, if he really wanted help, he would have provided the complete exception with stack trace, of course.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

registered iana media types (and a link to a registration form)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, if you tell us what you're having problems with ...

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What is the return value if the age is 18?

Either make the last one a simple "else", not an "else if" so the compiler is able to ensure that the method will always return something.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

No. The only thing I can recommend is what I already have recommended. Optimise the indexes on the table, and optimise your query. 10 minutes is more than enough time to update 1 million records. Heck, 2 minutes should be more than enough time.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

It definately will not be faster than the DB.

Edit: As long as you have your indexes properly defined. Have a DBA examine your table definition and your query and suggest possible changes to either the table indexes or your query.

Also, I hope you are using a PreparedStatement and batch mode, or, even better, a select/update (merge statement in oracle) type statement.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You can't declare a method inside another method, and that one is being declared inside of main (as is the entire class, seemingly).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I have no idea what it is you're actually asking here.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

In any case, you're getting an NPE, because each element of the array is null until you actually define something there. I.E.

Object[] i = new Object[3];

is the same as doing

Object[] i = { null, null, null };

add a

rec[i] = new Record()

before the call to read.

RandomAccessFile is still the way to go here. Especially if you're using it as a "DB".

masijade 1,351 Industrious Poster Team Colleague Featured Poster

And?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

This is exactly the sort of thing that RandomAccessFile is meant for.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, what do you think those errors are trying to tell you? They are not simply there for someone else to solve for you. Take the first one "Cannot find Symbol Keyboard" Well, what is Keyboard? What do you need to do so that the compiler recognises it?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You have a double opening brace '{' for your main method (which is the reason that it is indented so far). Fix that. Then remove one of the "closing" braces '}'

masijade 1,351 Industrious Poster Team Colleague Featured Poster

There is nothing wrong with the Error. It is 100% correct. Your code is wrong. (As noted above.)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

print the stack trace. How do you propose to find out what is going wrong when you ignore the cause.

In any case, get all of this scriptlet BS out of this JSP's. Create Beans and other helper classes and use those, don't use scriptlets, especially not ones of this size.

And use the web containers connection pool. Opening a new connection with every request is the pinnacle of inefficience.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

As long as the method is not static, you will be using whichever one is most appropriate to the object it is being called on. I.E. if the same method is declared in that object it will use that one, otherwise it will use the one from its super class, otherwise its super classes super class, etc, etc. All of this based from the actual objects type, not the type of the reference. I.E.

Object o = new String("a");
System.out.println(o.toString());

will print "a" and not "Object@xxxxxxx" because it is using Strings version of toString() and not Objects version of toString().

masijade 1,351 Industrious Poster Team Colleague Featured Poster

hmmm ... don't have the time to look into it right now, but you're just showing a one-dimensional array.

a two-dimensional one would look like:

String[][] ColorAndDebt = new String[2][2];
ColorAndDebt[0] = {"RED","285"};
ColorAndDebt[1] = {"BLUE","180"};

Uhm, no, array[index1][index2] = x is also a two dimensional array, just accessing an individual element rather than an entire array element from the "outer" array.

Anyway, OP. Use BufferedImage to create an image, then use getGraphics to get a Graphics2D object, then use setRGB once for each element.

Edit: But, in any case, unless you simply want to save it in that format to be "human readable", then you should simply be using ImageIO to save it as a regular image (format of your choice, i.e. gif, jpeg, png, etc) and you can use the varying Image methods to retreive the color and coordinate data directly from the image.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Okay, so what do you have so far. We are not here to do your work for you, but we are more than happy to help you correct yours.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

That should only happen if you have used the same id in both cases.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Configure the firewall to allow the connection.

Edit: IOW it is not a Java problem, it is a system configuration problem. If you do not know how to configure your firewall, then read it's documentation or contact its support.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Yoiu really need to fix the indentation of your code (a lot of your problems will be made clear doing that). And why do you have two { symbols after the class declaration, remove one of them, and remove the semicolon at the end of the constructor and initMenu declarations.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

It would help to know what error you get, and what line it refers to.

Edit: And use code tags when you post code.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Then the image was not in the same place as the class file, but rather one directory below the class file.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

In that form "cut.gif" needs to be located in the same directory as the class containing this call, inside the jarfile, of course.

No idea if that is what you meant by "program".

Seeing what execption is thrown, might help. The complete stacktrace, BTW. And don't forget to close the stream (preferrably in a finally block).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Yep, and that is using files, you need to use streams change

ImageIcon cut = new ImageIcon("images/cut.gif");

to

ImageIcon cut = new ImageIcon(ImageIO.read(getClass().getResourceAsStream("/images/cut.gif"));

assuming "images" is a "top-level directory" within the jarfile.

Edit: But that will leave the InputStream open so this is better

InputStream is = getClass().getResourceAsStream("/images/cut.gif");
ImageIcon cut = new ImageIcon(ImageIO.read(is));
is.close();
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Show me the code where you are defining and creating the Icons. That is probably where the problem is.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I don't believe that would work at all since you cannot have a "\" in a variable name, AFAIK.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Um, that would create a Button with the text "images\cut.gif", not an Icon.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

How are you loading the images? Hopefully with getResource (or getResourceAsStream) and not with File (or FileInputStream, etc) as the items in a jarfile are not Files, at least until the jarfile is unpacked.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

actually, his advice worked :)

Definately not using both double quotes and single quotes.

Then again, I have no idea how a replace or not replace would keep that particular string from being printed, especially since you can read and use a single \ when the things are read from a file, so I also need to ask, again, what else you were doing.

All of this, again, would have been cleared up by, showing your code and giving a better description of the actions you're taking.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Google "install4j" (I believe it's called that).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

A program (so long as it is "self-contained") is an application. What is your actual question here? Is it how to create an installer? Is it how to create "cool" start buttons on the desktop? etc, etc

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Thread Closed as it is old and has now become a simple dumping spot for "Give me teh codez" responses. No, thank you.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What, exactly, do you need help with?

masijade 1,351 Industrious Poster Team Colleague Featured Poster
public class PerformanceAppraissal {
  public static void main (String[] args) {
    System.out.println("Unsatisfactory");
  }
}
masijade 1,351 Industrious Poster Team Colleague Featured Poster

No help whatsoever.

@p00dle
Why don't you show us your "read" and "print out" code?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

If you insist on using RandomAccessFile (which I don't suggest), then call setLength(0) right after the seek.

However, since you're reading the entire file, then operating on the data, then writing the entire file, use a FileReader to read it (assuming simple text), then close that, and use a FileWriiter to write it, and then close that.

RandomAccessFile is meant mainly for use with datafiles that contain fixed-width data fields, not as a general purpose "file worker".

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Old post, but I still feel the need to respond. This is still not pass by reference. That is passing a copy of the reference value that points to the array. In which you can then change the reference values stored in the elements of the array, but it is still not pass by reference. Pass by reference would allow you to create a whole new array (i.e. new String[]) and have that change also take affect outside of the method, and that will not work of course.

Now, once more, for slow learners, there is no pass-by-reference in Java it is pass-by-value and pass-by-value only.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Do you know how to do it in HTML (since JSPs simply produce HTML pages)? If so, then do it, it's that simple. If not, find an HTML forum and ask there.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

There is another forum for hiring people to do your work for you. This one is not it.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

A shell script? Using ssh?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You are probably "sending your data" on the event thread which prevents any other event from triggering (and prevent most other GUI functions as well) until it is finished. Your action listener should start another thread and that thread should "send the data", or, better, you should start a new thread at program startup that is responsible for "sending the data" and create a queue that it reads from, and your action listener should then simply place things on that queue.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Yea, simply change what's being displayed.

It might help to know exactly what you want to do, but just so you know, "AJAX" essentially imitates for browser client actions what is essentially native to standalone applications, so don't start out by thinking about what you can do in AJAX (or any other language for that matter) or you are simply limiting yourself.

Think about what you want to do and then try implementing it.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

So what does

e.printStackTrace();

and

log2.write(e.toString());

produce?

Edit: P.S. Change

log2.write(e.toString());

to

log2.write(e.getClass() + ":  " + e.toString());
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Redirect STDERR and STDOUT to a file and see what shows up there, first. You can't diagnose anything without gathering any information.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Make sure the ssh is configured to allow public key access. Also, make sure your authorized_keys file is setup properly, and are you sure its asking for a password and not a passphrase, which is connected to the ssh key.