setCharacterStream() SQLFeatureNotSupportedException / AbstractMethodError using jTDS in EAP 6

Solution Verified - Updated -

Issue

  • Using the jTDS driver with a Microsoft SQL Server database
  • persistence.xml specifies the dialect as org.hibernate.dialect.SQLServer2008Dialect
  • An entity is defined with a @Lob String property (e.g. DATA in the error below)
  • SQLFeatureNotSupportedException / AbstractMethodError raised 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 of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In