Menu

#650 all columns are of type NULL

open
Meta data (46)
5
2012-08-15
2011-06-09
Anonymous
No

getParameterType() is returning java.sql.Types.NULL on all columns, after preparing even a simple query like "update tablename set fieldname = ? where otherfieldname = ?". This makes it really difficult to discover types on the fly and pass values properly (JSON -> SQL bridge, where I'm relying on the database to tell me what type it expects.) This works just fine with Jaybird for Firebird, but jTDS and SQLServer2000 ... not so much. Haven't tested with SQLServer2008 to see if that's any better.
Everything was working okay, apparently always falling back on setObject() which worked alright, but timestamp conversions from the JSON format (0/0/0T0:0) failed, causing me to look into it. I have special code to discover .TIMESTAMP fields and convert them, but if I don't get types back, I don't know to do it.

I read (http://sourceforge.net/tracker/index.php?func=detail&aid=1101649&group_id=33291&atid=407762) something about forcing the types to be present by trying to setting values for the parameters, but I tried that, even setting all parameters via .setNull(column#, java.sql.Types.LONGVARCHAR /and a few others, also trying .setObject() and .setString() /), and even refetching parametermetadata afterwards, but I still couldn't get anything but 0 for a typecode, and null / Object for the other type fields (typename and classname.)

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.