aspose file tools*
The moose likes JDBC and the fly likes problem with insert and select Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "problem with insert and select" Watch "problem with insert and select" New topic
Author

problem with insert and select

Sunil Tiwari
Ranch Hand

Joined: Sep 19, 2006
Posts: 49

in that case, can you send one more event after add to do search, so it will execute and give you the latest details on the screen


~ Neil (SCJP)
Scott Cook
Greenhorn

Joined: Aug 01, 2006
Posts: 14
Anthony,
Look at the error message:
java.lang.NullPointerException
at desktopapplication1.Datab.getColumnCount(Datab.java:48)

Your NPE is comming from line 48 (shows as line 3 below).



rsmd is null because your query was an update, not an execute. So, as others have said, this comes down to a design issue, not a database issue.
You have to make your code behave differently based on whether it's an update or execute.

Also, you definitely want to remove the quotes from around "null" on your INSERT statement in order for SQL to understand it correctly. That's not what's causing the NullPointerException.
Sunil Tiwari
Ranch Hand

Joined: Sep 19, 2006
Posts: 49

Is the issue resolved, Antony ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with insert and select