hsqldb

Spring/Hibernate/Junit example of testing DAO against HSQLDB

拜拜、爱过 提交于 2019-12-03 05:52:54
问题 I'm working on trying to implement a JUnit test to check the functionality of a DAO. (The DAO will create/read a basic object/table relationship). The trouble I'm having is the persistence of the DAO (for the non-test code) is being completed through an in-house solution using Spring/Hibernate , which eliminates the usual *.hbm.xml templates that most examples I have found contain. Because of this, I'm having some trouble understanding how to setup a JUnit test to implement the DAO to create

Database lock acquisition failure and hsqldb

笑着哭i 提交于 2019-12-03 04:41:46
I was trying to connect to a hsql db. I created one by running from C:\myhsql: java -cp .;C:\hsql\lib\hsqldb.jar org.hsqldb.Server -database.0 file:db\mydb -dbname.0 MYDB This created mydb in a directory called db . This folder now has a .lck,tmp,script,properties files with name mydb, and similar files with name MYDB in current folder . In java code I tried Class.forName("org.hsqldb.jdbcDriver"); connection = DriverManager.getConnection("jdbc:hsqldb:file:db/sjdb", "SA", ""); When I run the program, I am getting this error: java.sql.SQLException: Database lock acquisition failure: lockFile:

What is the best way to launch HSQLDB for unit testing, when working with spring, maven and hibernate?

旧城冷巷雨未停 提交于 2019-12-03 01:44:39
In my project I can successfully test database code. I'm using Spring, Hibernate, HSQLDB, JUnit and Maven. The catch is that currently I have to launch HSQLDB manually prior to running the tests. What is the best way to automate the launching of HSQLDB with the technologies being used? I am assuming that with hsql you are referring to HSQLDB . Configure your database url for JDBC drivers (for hibernate etc) to embedded memory based version of HSQLDB: jdbc:hsqldb:mem:myunittests Then a inprocess version of HSQLDB automatically starts that stores stuff to memory. No need to start any external

Create an in-memory database structure from an Oracle instance

余生长醉 提交于 2019-12-03 01:43:00
问题 I have an application where many "unit" tests use a real connection to an Oracle database during their execution. As you can imagine, these tests take too much time to be executed, as they need to initialize some Spring contexts, and communicate to the Oracle instance. In addition to that, we have to manage complex mechanisms, such as transactions, in order to avoid database modifications after the test execution (even if we use usefull classes from Spring like

Best SQL browser for HSQLDB? [closed]

我与影子孤独终老i 提交于 2019-12-03 01:37:52
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . Whats the best browser tool for HSQLDB databases? 回答1: HSQL has built-in GUI query tool called Database manager. In the directory of

Auto-incrementation with HSQLDB (2.2.8) + DDLUtils

匿名 (未验证) 提交于 2019-12-03 01:36:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to use HSQLDB as an embedded database but am having trouble getting it to auto-increment . As far as I understand, [CALL] IDENTITY() can be used to get the last primary key value. However, experiments through both iBatis and HSQLDB's DatabaseManagerSwing continually return a 0 value. How can I get auto-incrementation to work with HSQLDB? Edit: I didn't mention that I'm using DDLUtils to autogenerate tables. The following does not suit HSQLDB: <?xml version="1.0"?> <!DOCTYPE database SYSTEM "http://db.apache.org/torque/dtd/database.dtd

Which is better H2 or HSQLDB? [closed]

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: HSQLDB 2.0 is soon to be released. I wonder if it will outperform H2 since, as far as I know, most users prefer H2 than HSQLDB. I am interested in the MVCC support of HSQLDB 2.0. I have learned that MVCC on H2 is still experimental. With regards to support/documentation, concurrency, performance, which is better between the two? 回答1: I am the developer of a database abstraction library ( jOOQ ), which supports both databases. My 130+ integration tests cover a lot of functionality, including the calling of stored procedures and

Maven and Hsqldb: org.hsqldb.HsqlException: Client driver version greater than &#039;2.1.0.0&#039; is required. HSQLDB server version is &#039;2.3.4&#039; (on mac)

匿名 (未验证) 提交于 2019-12-03 01:06:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: What I want to do How to get maven/eclipse to point to 2.3.2 jar instead? Connect to the HSQL db via Java/jdbc (I assume I should be able to do this once I have solved the above) My settings It seems that my hsql server is using 2.3.4. However I do not see why my local Eclipse (the client) is using 2.1.0.0. I have set up maven and it seems to be pointing to the 2.3.2 jar. How my Eclipse package explorer looks Other things I have checked / done Updated my path variables in my bash_profile ( export HSQL_HOME=/Users/user/hsqldb; export PATH=

HSQLDB: enable LOB compression for existing database

匿名 (未验证) 提交于 2019-12-03 01:02:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using an embedded HSQLDB 2.3.2 instance to store XML documents as LOBs for a while in an application which has intermittent connection to wherever the documents are supposed to end. To limit HSQBDL's .lobs file size growth, I enabled LOB compression through the jdbc connection URL as mentioned in the documentation (using hsqldb.lob_compressed=true), but from what I've recently discovered this URL parameter has no effect whatsoever. If I understand the HSQLDB JDBC URL parsing code correctly, org.hsqldb.persist.Logger#setVariables() should

Running a script to create tables with HSQLDB

喜欢而已 提交于 2019-12-03 00:31:58
I use hsqldb to run my unit tests that need a database access. For the moment, when I want to create a table for a specific test, I have the following code: private void createTable() { PreparedStatement ps; try { ps = getConnection().prepareStatement("CREATE TABLE T_DATE (ID NUMERIC PRIMARY KEY, DATEID TIMESTAMP)"); ps.executeUpdate(); } catch (SQLException e) { e.printStackTrace(); } } The getConnection() method retrieve a DataSource defined in a Spring context: <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value=