简体   繁体   English

hsqldb.jdbc中的createArrayOf字符串返回AbstractMethodError

[英]createArrayOf string in hsqldb.jdbc returns AbstractMethodError

I am writing test cases for my java program that runs with an Oracle database. 我正在为与Oracle数据库一起运行的Java程序编写测试用例。 My code is : 我的代码是:

st = conn.prepareStatement( MY_QUERY, ResultSet.TYPE_SCROLL_INSENSITIVE,
                ResultSet.CONCUR_READ_ONLY);

            Array array  = conn.createArrayOf("VARCHAR", ids);
            st.setArray(1, array);
            rs = st.executeQuery();

where the query is 查询在哪里

QUERY = "SELECT * from TABLE where id in ?"

We are using the hsqldb database for our testing. 我们正在使用hsqldb数据库进行测试。 However, running the above code in tests gives 但是,在测试中运行上面的代码可以

java.lang.AbstractMethodError: org.hsqldb.jdbc.jdbcConnection.createArrayOf(Ljava/lang/String;[Ljava/lang/Object;)Ljava/sql/Array;

on the createArrayOf line. createArrayOf行上。

I haven't been able to find a solution to this problem. 我还没有找到解决此问题的方法。 Would appreciate any help given. 将不胜感激。 Thanks 谢谢

In the official HSQLDB JavaDoc (Version 2.x) of the class JDBCConnection (which implements java.sql.Connection ) the createArrayOf method is availble and documented: JDBCConnection类的正式HSQLDB JavaDoc (版本2.x)(实现java.sql.Connection )中, createArrayOf方法createArrayOf并记录如下:

createArrayOf createArrayOf

public Array createArrayOf(String typeName, Object[] elements) throws SQLException 公共数组createArrayOf(String typeName,Object [] elements)抛出SQLException

This method is supported since HSQLDB version 2.x. 从HSQLDB 2.x版本开始支持此方法。 Therefore, you should update your application to use the latest HSQLDB driver which can be downloaded here . 因此,您应该更新您的应用程序,以使用可以在此处下载最新HSQLDB驱动程序

According to the changelist , you should use at least version 2.2.1 of HSQLDB driver as the dev team " fixed type limitations of Connection#createArrayOf " method with this release. 根据更改列表 ,在此版本中,至少应使用HSQLDB驱动程序2.2.1版作为开发团队的“ Connection#createArrayOf的固定类型限制 ”方法。

HSQLDB中的SQL查询语法不同:

SELECT * from TABLE WHERE id IN(UNNEST(?))

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 createArrayOf AbstractMethodError - createArrayOf AbstractMethodError JDBC 错误:AbstractMethodError:com.microsoft.sqlserver.jdbc.SQLServerConnection.createArrayOf(Ljava/lang/String;[Ljava/lang/Object;)Ljava/sql/Array - JDBC ERROR : AbstractMethodError: com.microsoft.sqlserver.jdbc.SQLServerConnection.createArrayOf(Ljava/lang/String;[Ljava/lang/Object;)Ljava/sql/Array ArrayList的JDBC createArrayOf - JDBC createArrayOf from ArrayList JDBC SELECT COUNT(*) 在 HSQLDB 上返回空结果集 - JDBC SELECT COUNT(*) returns empty resultset on HSQLDB java.lang.AbstractMethodError:在sqlite上调用createArrayOf方法时出现org.sqlite.Conn.createArrayOf错误 - java.lang.AbstractMethodError: org.sqlite.Conn.createArrayOf error while calling createArrayOf method on sqlite 方法createArrayOf的mysql JDBC驱动程序出现错误 - Error with mysql JDBC driver for method createArrayOf jdbc 连接的 `createArrayOf` 的最大元素数 - max number of elements for a jdbc connection's `createArrayOf` 带有文件路径上空格的JDBC连接字符串(sqlite,hsqldb) - JDBC connection string with spaces on file path (sqlite, hsqldb) JDBC connection.getschema() AbstractMethodError - JDBC connection.getschema() AbstractMethodError 未捕获的可抛出 java.lang.AbstractMethodError: org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.createArrayOf - Uncaught Throwable java.lang.AbstractMethodError: org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.createArrayOf
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM