wood burning stoves*
The moose likes JDBC and the fly likes Solved : Why does PreparedStatement getMetaData returns null Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Solved : Why does PreparedStatement getMetaData returns null" Watch "Solved : Why does PreparedStatement getMetaData returns null" New topic
Author

Solved : Why does PreparedStatement getMetaData returns null

Darren Wilkinson
Ranch Hand

Joined: May 22, 2007
Posts: 35
Hello,

I'm puzzled by why the line in my code where I try to get the meta data of a prepared statement returns null, as the API says,

Consequently, it is possible to invoke the method getMetaData on a PreparedStatement object rather than waiting to execute it




Thanks for looking at this for me.
[ July 08, 2008: Message edited by: Darren Wilkinson ]
Darren Wilkinson
Ranch Hand

Joined: May 22, 2007
Posts: 35
It's ok, I re-read the API with fresh eyes and noticed its says getMetaData() returns null if the underlying driver cannot return a ResultSetMetaData object.

I'm connecting to a MSSQL database using the jtds driver.

So the null return must be because this driver does cannot return a ResultSetMetaData object.

Thanks for taking a look and sorry for wasting anyones time.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Solved : Why does PreparedStatement getMetaData returns null
 
Similar Threads
comparing two ResultSet
ResultSet not open. Operation 'last()'
http response code 400 in httpurlconnection's getinputstream
returned null;
problem with gui