使用JTDS驱动程序在SQLServer中插入Clob数据时出错

时间:2015-01-06 06:46:05

标签: java sql-server-2008 jdbc jtds

我需要在SQLServer表中插入clob数据。

以下代码正在抛出java.lang.AbstractMethodError: net.sourceforge.jtds.jdbc.ConnectionJDBC3.createClob()Ljava/sql/Clob

public void executeQueryWithPreparedStatements(int messageID,String xmlMessage,String xmlDataStorageType) throws SQLException {
        String dataTypeSpecificSQL = "Insert into OXI_MESSAGE_AS_CLOB(messageid,MSG_content) values (?,?)";
        PreparedStatement statement = null;
        try {
            statement = connection.prepareStatement(dataTypeSpecificSQL);
            statement.setInt(1, messageID);

            Clob clobData = connection.createClob();
            clobData.setString(0,xmlMessage);
            statement.setClob(2, clobData);

            statement.executeUpdate();

        }catch(SQLException sqle){
            throw  sqle;
        }finally {
            releaseResource(statement);
        }
    }
  1. 我正在使用Jtds-1.2.8.jar

  2. 当我检查源代码时,我发现createClob()类中没有net.sourceforge.jtds.jdbc.ConnectionJDBC3方法

  3. 是否有其他人也遇到过这个问题?

  4. 请提供有关如何使用此问题在SQLServer中使用Jtds驱动程序插入clob数据的建议?

0 个答案:

没有答案
相关问题