Any help with the following problem would be greatly appreciated...We are using Spring 2.5.6 with Websphere 6.1 and MS SqlServer 2005. We have the following DAO code:
This works fine when executed within a junit. But when insert() executes in websphere, we get the following exception:Code:public void init() { insert = new SimpleJdbcInsert(getDataSource()) .withTableName(TABLENAME) .usingGeneratedKeyColumns(ID); } public long insert(...) { Number generatedKey = insert.executeAndReturnKey( new BeanPropertySqlParameterSource(myobj)); return generatedKey.longValue(); }
PreparedStatementCallback; uncategorized SQLException for SQL []; SQL state [HY000]; error code [0]; [IBM][SQLServer JDBC Driver]Unsupported method: Connection.prepareStatement; nested exception is java.sql.SQLException: [IBM][SQLServer JDBC Driver]Unsupported method: Connection.prepareStatement
SOM
org.springframework.jdbc.UncategorizedSQLException : PreparedStatementCallback; uncategorized SQLException for SQL []; SQL state [HY000]; error code [0]; [IBM][SQLServer JDBC Driver]Unsupported method: Connection.prepareStatement; nested exception is java.sql.SQLException: [IBM][SQLServer JDBC Driver]Unsupported method: Connection.prepareStatement
at org.springframework.jdbc.support.AbstractFallbackS QLExceptionTranslator.translate(AbstractFallbackSQ LExceptionTranslator.java:83)
at org.springframework.jdbc.support.AbstractFallbackS QLExceptionTranslator.translate(AbstractFallbackSQ LExceptionTranslator.java:80)
at org.springframework.jdbc.core.JdbcTemplate.execute (JdbcTemplate.java:607)
at org.springframework.jdbc.core.JdbcTemplate.update( JdbcTemplate.java:824)
at org.springframework.jdbc.core.simple.AbstractJdbcI nsert.executeInsertAndReturnKeyHolderInternal(Abst ractJdbcInsert.java:421)
at org.springframework.jdbc.core.simple.AbstractJdbcI nsert.executeInsertAndReturnKeyInternal(AbstractJd bcInsert.java:402)
at org.springframework.jdbc.core.simple.AbstractJdbcI nsert.doExecuteAndReturnKey(AbstractJdbcInsert.jav a:369)
at org.springframework.jdbc.core.simple.SimpleJdbcIns ert.executeAndReturnKey(SimpleJdbcInsert.java:110)


Reply With Quote