masijade 1,351 Industrious Poster Team Colleague Featured Poster

You cannot do an insert (update or delete either) with executeQuery, you need to use either executeUpdate or execute. If the driver you are using is letting you use executeQuery for a query that actually changes the data then there is a bug in the JDBC driver and you should report that. That is what that exception meant, as it clearly states. Judging by your first response, I assume that you didn't bother to look at the API docs and just got indignant that I said you should. All I can say is to learn to read exceptions and to use the API docs, it will save you alot of time in the future. And, judging by your second post you seemingly, eventually, figured that with the method out but didn't want to admit it.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Can not issue data manipulation statements with executeQuery()

Uhm, what do think this might mean?


Look at the API docs for statement/preparedstatement and see if there is another method that is more applicable.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Because everything about Apple is proprietory and they want it that way, and they want to keep it that way.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, even your comments declare that you are "ending" a class, then you continue to declare variables and methods? To which class are those to belong?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Okay. Finished.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

We are not a (home)work service. Try it yourself, and post your attempt along with detailed information if it "doesn't work".

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What "errors". The complete stack trace / compiler message please.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

After setting the font try calling validate() and or repaint() on the panel containing the items on which the font changes. If that still doesn't do it, then, on the component on which the font changes call component.setText(component.getText()) after setting the font and then still call validate()/repaint().

masijade 1,351 Industrious Poster Team Colleague Featured Poster

So, in other words, you don't want any advice you simply want to here us say "Your code is perfect and it should work, something else about the system is torqued." Well, okay, now you've heard it, believe what you will.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, it might help to know what error you're getting, and what exactly you are trying and what you are trying it with.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

And?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

It might help to know what the error is. Also, many times, you have to actually close the connection to access before changes are committed. Acess is really not suited to any kind of web application.

Also, you really need to remove these scriptlets from your JSP. Scriptlets are extremely discouraged these days and are only still allowed to keep from breaking backwards compatability. Create some beans and/or other application services.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Of course it doesn't. You would have to actually use some layout.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Oh God, Why?, Why? Why?

panel3.setLayout(null);

IMHO this is the worst thing that you can do. Especially when you are only using standard labels and text fields. In some rare corner cases it may be advantageous, but for this? No!

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Okay, now I've seen that you've declared it static. To tell you the truth, I wouldn't though. It's just bad form, at the very least. Anyway ...

Call validate() and or repaint() on the contentPane of the frame. Another note is the description of the "setSelected" method.

setSelected

public void setSelected(boolean b)

Sets the state of the button. Note that this method does not trigger an actionEvent. Call doClick to perform a programatic action change.

Parameters:
b - true if the button is selected, otherwise false

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Edit: I know this, but you seemingly don't as the things you are saying works, work for ArrayLists, not arrays, and you are using ArrayList methods on arrays rather than the corresponding array fields. So what is your point?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I used the term size in reference to the i index below

planes_array[i];

not calling it a method.
The other thing is that if one doesn't initialize an array as below:

String [] j;
String [] k = new String{"ken","jimmy"};
j= k;

The program would still run (though this is highly discouraged).
That's all I'm saying..

The thing is, the OP wants an array of ArrayLists not an ArrayList of arrays, so the "size()" call in the for loop is wrong, as you have an array at that point and not an ArrayList. And, if you use that

planes_array[i]

without initialising the array with at least

ArrayList planes_array[] = new ArrayList[someNumber];

you will get an NPE. So, once again, my comments from the last post apply, and none of your comments in this post apply.

Thank you, please come again.

Edit: BTW this

String [] j;
String [] k = new String{"ken","jimmy"};
for(int i=0;i<k.length;i++)
{
    j[i] = new String();//initialize the elements of the array
    j[i]=k[i];
}

also throws an NPE at the line

j[i] = new String();//initialize the elements of the array

and would at the line

j[i]=k[i];

as well if it could make it that far for the same reason that the array j is not initialised. Actually, in this case, you will get compiler messages because you haven't initialised it at all. The OP did initialise his, but to null.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You still need to initialise the array however other wise

planes_array[i]

is essentially

null[i]

and arrays do not have size() method, they have a length attribute.

Edit: Please, please, please. If you are going to post code as a "solution" then at least make sure that it is compilable (typos we forgive) and that it is actually plausible.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Just let it put the version variable in and don't worry.

Just remember, however, that if the interface of the class changes (i.e. new public/protected methods, etc) to change that number or you will have problems if the class is actually serialised as part of the app.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Like any Array

String[] example = new String[5];
masijade 1,351 Industrious Poster Team Colleague Featured Poster

In this line

QueryBuilderDemo.jc.setSelected(true);

You need an actual instance of QueryBuilderDemo, not the Class.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well at least you tried. Those "*" don't belong in the code tags and cut-n-pasting the unformatted code from an earlier post, rather than pasting the original code, doesn't help, as you can see above. So, I went back and added code tags to the "original" code post, as well.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

can you write some program for ASCII converter?
please

Finished.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

That is not "64-bit" dependent. That has been that way on NT and on every Windows system since Vista.

masijade 1,351 Industrious Poster Team Colleague Featured Poster
decimalVal = (d*3600) + (m*60) + s;

not

decimalVal = (d*3600) + (m/60) + s;
masijade 1,351 Industrious Poster Team Colleague Featured Poster

A simple counting program.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

All I can say is, in the distribution instructions/readme tell the user that a mysql needs to be present.

A better idea, if the DB is not suppossed to get all that large, would be to distribute derby.jar with your application and simply create the DB on the fly.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I have changed that post. Give the new advice a try.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Edit: Nevermind. I misunderstood you a bit. All I can say there is to place those few lines (the asking of the question and the if statements) into a "while(true)" loop and "break" from the loop when a valid answer is encountered.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Okay? I know that. I am asking you that when the user does not input 1 then what do you need to do to achieve the same effect, and where do you need to do it?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, lets see. A latitude/longitude coordinate is in degrees, minutes, seconds (with decimal). 60 seconds to a minute, 60 minutes to a degree. So, first, convert your two longitudes to "absolute" numbers (i.e. (degrees * 3600) + (minutes * 60) + secs) and get the difference between the two (i.e. the higher - the lower). Now, divide this by the pixel width of the image, save these three numbers (the left, right, and interval). Now, do the same with the lattitudes and the height.

Now, when someone clicks on the map get that coordinate in pixels. Multiply the "x" by the width interval and the y be the height interval (if you want the coordinate from the "center" of the pixel, rather than the upper left corner of the pixel than add half the interval to each). Now add the "x" result to the "left" number (or subtract it if the left number was the larger). Do the same with the "y" result and the "top" number.

Now, (number / 3600) rounded down is the degrees, ((number % 3600) / 60) rounded down is the minutes, this ((number % 3600) % 60) are the seconds.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, lets look at this. Your while condition is

while (choice2 == 1)

So, in order for your while loop to "continue", choice2 needs to have what value?

Now, where are you "showing" your error messages? In an if statement block, right? So, what do you think you might add to that block to ensure that condition in your while loop expression is met?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Java doesn't have any Swings. You find those in playgrounds with kids using them. Now, if you mean the Java Swing (note no s on the end) API, then say that.

You might want to post the relevant parts of your code. And, I hope, you are using a JDialog (or JOptionPane) for the "frame" that opens and not a JFrame. If not, using one of those may solve your problem almost in and of itself.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Try here.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You could show some of your code. And try some debug-like print statements to see what happens, and what doesn't. And, I assume, you do not have any empty catch blocks?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Set up a web service? And access the db through "proxy". In any case, MySQL can at least do SSL, so make sure to, at the very least, use that, however, I do not know if the authentication attempt is already encrypted, or maybe the channel is only encrypted after connection/authentication has been made. In which case, it doesn't do much good anymore.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

:sigh: (all around)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Thank you. I suppose that I've configured grants properly. It seems that the problem is really connected with opening the standard DB port. Hmm, I'm not very good in this topic... I've found the following http://msdn.microsoft.com/en-us/library/ms175043.aspx. Is it exactly what you mean?

That's the process, but make sure you configure for a MySQL port and not an SQL Server port (which is what's described there). Also, you do know that it is extremely unsafe to expose these ports, right?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

hey, i also doing the same process. i have created mysql database using my sql i have connect this with jdbc by connector/j but when i execute this it shows error

C:\Documents and Settings\prudenforce\Desktop\servlets-examples>java GetAllRows
Exception in thread "main" java.lang.NoClassDefFoundError: GetAllRows
Caused by: java.lang.ClassNotFoundException: GetAllRows
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Could not find the main class: GetAllRows. Program will exit.
please help me to solve my problem.

Different problem. Start your own thread and learn about classpaths.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, post your code and all error/compiler messages as well as the difference between the expected output and the actual output and we'll help you correct it. Otherwise go here. We are not a homework service.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Okay? Good for you. I hope you're doing alright with that.

Ezzaral commented: Exactly what I thought when I read the post. +14
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Firewal, firewall, firewall. You might have opened the "phpadmin" port (whatever port that is), but you seemingly have not opened the standard DB port, and your firewall simply drops packets.

Also, don't forget to properly configure your grants.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

It would help to know what you are actually trying to acheive here, as this is probably not the right way to do it.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

How do I split?

See the API docs for String (see my hint about looking at the API docs for Double, and now, since you're talking about "splitting" a String it should have been logical to at least look at the API docs for String).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

P.S. why is this called "MatchApplet" (an eventual Applet I would assume) but has a main method? You also know, I assume, that you won't be able to read files on the client from an Applet, right? At least not without signing the Applet and/or security policy changes on the client.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, of course. Why would you assume that parseDouble takes a list of doubles. If you actually look at the API you would see it takes a String representing a single double value, of course. Split the String first, of course, and call parse Double on each element.

I feel obliged to mention that another possibility is to use Scanner. You'll have to get someone else to help you with that though, as I don't use Scanner its performance is not "up to snuff" for what I do.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What problem? I am not going to play compiler and JVM rolled into one to try and figure it out.

Edit: Which means, of course, that I haven't even looked at the code. Give me the complete exception and/or compiler warning/error or explain, in detail, the difference between the expected result and the actual result if there was no error.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

A bean? A session context object? an application context object? etc, etc, etc.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Double.parseDouble(str)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Put a "break" in that if statement. Or use a "while" statement.