hsqldb

H2, HSQLDB or any other embedded database using an InputStream

社会主义新天地 提交于 2019-12-02 02:59:59
问题 Can I use H2, HSQLDB, or any other embedded database, with a database from an InputStream instead of a file? I'm planning to use AssetManager.open() on Android, which can return an InputStream in random access mode. 回答1: H2 supports a pluggable file system that allows you to access read-only databases in a zip or jar files. However, there is currently no file system implementation for the AssetManager . It should be relatively easy to implement it. The best starting point is probably

Workaround in UCanAccess for multi-value fields: “incompatible data type in conversion: from SQL type OTHER”?

点点圈 提交于 2019-12-02 02:42:18
I am trying to use UCanAccess to query a MS Access .accdb file. Everything works great, except when I query multi-value fields. For example those that have entries in the Row Source of a table field's Lookup tab in design view in MS Access. My code crashes when I try to output the result: ResultSet rslt = stmt.executeQuery("SELECT [singleValue], [multiValue] FROM [TableName];"); int count = 0; while (rslt.next()) System.out.println(count++ + "\t" + rslt.getString(1) + "\t" + rslt.getString(2)); The ResultSet is returned fine, and the singleValue prints fine, but the following error is thrown

H2, HSQLDB or any other embedded database using an InputStream

假如想象 提交于 2019-12-02 02:20:35
Can I use H2, HSQLDB, or any other embedded database, with a database from an InputStream instead of a file? I'm planning to use AssetManager.open() on Android, which can return an InputStream in random access mode. H2 supports a pluggable file system that allows you to access read-only databases in a zip or jar files . However, there is currently no file system implementation for the AssetManager . It should be relatively easy to implement it. The best starting point is probably FileSystemZip and FileObjectZip . Most databases need random access to underlying files so an InputStream will not

Using LIKE % in Hibernate

无人久伴 提交于 2019-12-02 02:07:32
问题 How do I use LIKE % in Hibernate. I want to use a SQL with LIKE % in my hbm.xml file. I have 2 queries which I am consolidating to 1. The query looks like this: select * from PAY_GROUP_VW where CASE_SID=? AND CASE_TLE like %?% I also tried %?% . I have used like clause without % and it works. But % does not work. Wrapped exception: org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is org.hibernate.exception.SQLGrammarException: could

Hsqldb version issue: Client driver version greater than . is required

可紊 提交于 2019-12-02 01:44:14
问题 I am getting following error in my hsqldb server. [Server@85ede7b]: [Thread[HSQLDB Connection @17bf2dab,5,HSQLDB Connections @85ede7b]]: 0:Failed to connect client. Stack trace follows. org.hsqldb.HsqlException: Client driver version greater than '-268.-50.-11.-82' is required. HSQLDB server version is '2.3.2' at org.hsqldb.error.Error.error(Unknown Source) at org.hsqldb.server.ServerConnection.init(Unknown Source) at org.hsqldb.server.ServerConnection.run(Unknown Source) at java.lang.Thread

Hsqldb version issue: Client driver version greater than . is required

旧时模样 提交于 2019-12-02 01:03:10
I am getting following error in my hsqldb server. [Server@85ede7b]: [Thread[HSQLDB Connection @17bf2dab,5,HSQLDB Connections @85ede7b]]: 0:Failed to connect client. Stack trace follows. org.hsqldb.HsqlException: Client driver version greater than '-268.-50.-11.-82' is required. HSQLDB server version is '2.3.2' at org.hsqldb.error.Error.error(Unknown Source) at org.hsqldb.server.ServerConnection.init(Unknown Source) at org.hsqldb.server.ServerConnection.run(Unknown Source) at java.lang.Thread.run(Thread.java:745) please suggest You are attempting to connect to a HSQLDB server but you are not

Using LIKE % in Hibernate

扶醉桌前 提交于 2019-12-02 00:50:58
How do I use LIKE % in Hibernate. I want to use a SQL with LIKE % in my hbm.xml file. I have 2 queries which I am consolidating to 1. The query looks like this: select * from PAY_GROUP_VW where CASE_SID=? AND CASE_TLE like %?% I also tried %?% . I have used like clause without % and it works. But % does not work. Wrapped exception: org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query at org.springframework.orm.hibernate3.SessionFactoryUtils

Cross join not recognized in HSQL

泪湿孤枕 提交于 2019-12-01 23:37:33
I am using HSQL ver 1.7. There is a part where I have a HQL like the following String hql = "from ProductInv prodInv where prodInv.product.id in (:prodList)"; prodList contains list of product ids and the above hql is to get product inventories of the required product ids in prodList. This hql is translated to a native sql query with "cross join". When this works against my actual db2, it works fine. But my unit tests based on HSQL fails. It says "cross join" is not a recognized keyword. You need to upgrade to one of the latest versions of HSQLDB (HSQLDB Versions 1.7.x are at least 7 years old

Hibernate, HSQL, and Update w/ Limits

天大地大妈咪最大 提交于 2019-12-01 23:06:12
Is it possible to limit the number of rows that are updated using Hibernate/HQL? For instance: Query q = em.createQuery("UPDATE MyObj o Set o.prop = :prop"); q.setParameter("prop", "foo"); q.setMaxResults(myLimit); int res = q.executeUpdate(); if (res > myLimit) { // This is entering here and I don't want it to! } I've been Googling around and such, and I am trying to use HQL so that I can do some unit tests using HSQL DB in memory dbs, as well as using MySql in deployment. MySql supports the Limit clause on Update statements, but HSQL does not, and doing an UPDATE with an inner select in HSQL

JUnit/HSQLDB: How to get around errors with Oracle syntax when testing using HSQLDB (no privilege and/or no DUAL object)

女生的网名这么多〃 提交于 2019-12-01 22:24:37
问题 I have DAO code which contains some JDBC with Oracle-specific syntax, for example: select count(*) cnt from DUAL where exists (select null from " + TABLE_NAME + " where LOCATION = '" + location + "')") I am running JUnit tests on this DAO method using an in-memory HSQLDB database. Apparently the DUAL table is Oracle specific and causes an error when I run the test: org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [select count(*) cnt from DUAL where exists