aspose file tools
The moose likes JDBC and Relational Databases 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 The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "problem with insert and select" Watch "problem with insert and select" New topic

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

Joined: Aug 01, 2006
Posts: 14
Look at the error message:
at desktopapplication1.Datab.getColumnCount(

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 ?
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: problem with insert and select