setCharacterStream() SQLFeatureNotSupportedException / AbstractMethodError using jTDS in EAP 6
Issue
- Using the jTDS driver with a Microsoft SQL Server database
persistence.xmlspecifies the dialect asorg.hibernate.dialect.SQLServer2008Dialect- An entity is defined with a
@LobStringproperty (e.g.DATAin the error below) SQLFeatureNotSupportedException/AbstractMethodErrorraised persisting to the DB (e.g. during insert)
... could not insert: [org.myapp.MyEntity] [insert into MYENTITY (DATE, DATA) values (?, ?)]: java.sql.SQLFeatureNotSupportedException: Method is not implemented by JDBC driver
at org.jboss.jca.adapters.jdbc.WrappedConnection.checkException(WrappedConnection.java:1636)
at org.jboss.jca.adapters.jdbc.WrappedStatement.checkException(WrappedStatement.java:1267)
at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.setCharacterStream(WrappedPreparedStatement.java:1451)
at org.hibernate.type.descriptor.sql.ClobTypeDescriptor$4$1.doBind(ClobTypeDescriptor.java:114)
at org.hibernate.type.descriptor.sql.BasicBinder.bind(BasicBinder.java:93)
at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:284)
...
at org.jboss.as.jpa.container.AbstractEntityManager.persist(AbstractEntityManager.java:563)
...
Caused by: java.lang.AbstractMethodError
at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.setCharacterStream(JtdsPreparedStatement.java:1274) [jtds.jar:1.2]
at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.setCharacterStream(WrappedPreparedStatement.java:1447)
Environment
- Red Hat JBoss Enterprise Application Platform (EAP) 6
- Hibernate 4
- Microsoft SQL Server
- jTDS JDBC driver
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.