Next Button Error
I have encountered error with my code.
I have a "next" button in my application. But when i try to run a code on its
click, for first time it runs perfectly fine but for next attempt it throws a NullPointerException and also the button remains pressed. Please Help. The button click code is as follows:
rs=st.executeQuery("Select * from Student");
String ak=new Integer(a).toString();
System.out.println("Exception z" +z);
First, using the code tags makes your code much more readable. Next, you don't post the trace of the exception so we have no clue what line it is being thrown on. Last, you should close the database connection when you are done with it.
Is this code in a worker thread?
If not that would probably explain the button staying pressed after a crash.
I'll try to inculcate the mentioned things.