It's not a secret anymore!*
The moose likes JDBC and the fly likes MAJOR problem with JDBC-ODBC..please help!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "MAJOR problem with JDBC-ODBC..please help!!" Watch "MAJOR problem with JDBC-ODBC..please help!!" New topic
Author

MAJOR problem with JDBC-ODBC..please help!!

Blaine Mincey
Greenhorn

Joined: Nov 28, 2000
Posts: 15
Hi. I am having an issue with what I believe to be the JDBC-ODBC bridge. I have used similar SQL at clients using a JDBC Driver but have not used this with JDBC-ODBC. The SQL is rather simple:
// the parameter markers are all strings in the
// format 'string','string','string', etc.
delete from <table> where id not in ( ? ) and
state in ( ? ) and
code in (? )
I keep getting the error:
java.sql.SQLException: [Microsoft][ODBC SQL Server Driver][SQL Server]The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.
Any help would be greatly appreciated....
Thanks!
Blaine Mincey
blaine_mincey@mindspring.com
Blaine Mincey
Greenhorn

Joined: Nov 28, 2000
Posts: 15
Well, I was finally able to work around the problem by creating the Statement on the fly instead of using a PreparedStatement. Looks like the more 'elaborate' PreparedStatement was getting hosed through ODBC....if anyone has anything to add, I would love to hear ( read ) it!
Thanks again!
Blaine
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: MAJOR problem with JDBC-ODBC..please help!!