Hello,
I'm connecting to a SQLServer 2000 and SQLServer 2005 database and I ran into this issue:
Code:
util.JDBCExceptionReporter - [BEA][SQLServer JDBC Driver]Unsupported method: Connection.prepareStatement
org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not insert: [(removed)]; uncategorized SQLException for SQL [insert into (removed) values (?)]; SQL state [HY000]; error code [0]; [BEA][SQLServer JDBC Driver]Unsupported method: Connection.prepareStatement; nested exception is java.sql.SQLException: [BEA][SQLServer JDBC Driver]Unsupported method: Connection.prepareStatement
java.sql.SQLException: [BEA][SQLServer JDBC Driver]Unsupported method: Connection.prepareStatement
I've managed to solve it following the advice in this forum:
http://forums.datadirect.com/ddforums/message.jspa?messageID=3976It says:
Quote:
Against SQL Server 2000, the driver can not implement this method correctly in the general case because SQL Server 2000 does not allow you to return the value of an arbitrary column from an insert, update or delete statement. At least not with out making an extra round trip to the server, which negates the purpose of this method.
I have seen implementations of this method by other drivers where the value returned will be the value of the identity column regardless of which column was actually asked for. I believe that implementation is bad. I feel it is much worse for a driver to return incorrect information than it is to not be able to return the information. Assuming the id column in the statement is an identity column, then Hibernate may have just gotten lucky that it worked in the testing that they did.
We will look into this further.
and
Quote:
To temporarily work around this issue set the hibernate.jdbc.use_get_generated_keys option to false in the hibernate.properties file.
hibernate.jdbc.use_get_generated_keys false
We are working to update the drivers so this workaround will not be necessary.
My question is: has the issue been resolved? If so, in what version?