hsqldb

how to enable referential integrity in HSQL Db in-memory unit tests

戏子无情 提交于 2019-12-05 12:09:08
I have over 200 unit tests for my entire JPA backend and they all work great on hsql db 2.2. I have the tests running in a continuous build environment to verify the stability of the system. Except that when I ran them on Oracle 11, some tests failed with referential integrity constraints. It was due to a bug in my code but the fact that I couldn't find them in hsqldb concerns me and violates the whole point of having a lightweight-in-memory-jpa-compliant db when it's not really compliant! Is there a setting that I can trigger for hsqldb to consider referntial integrity while running tests. I

Connect to in memory Hsql (hypersonic) database with DatabaseManager while debugging tests

心不动则不痛 提交于 2019-12-05 11:51:02
I would like to connect to an in-memory HSQL database instance using the hsql DatabaseManager (or the swing version, it doesn't matter) while debugging tests in my IDE (Intellij IDEA 11.1.2). I have tried as was suggested by this answer , but every time I do so the DatabaseManager process/thread (I don't know which) starts and freezes. If kill/force quit it, the debug session also dies. How can I do this without the DatabaseManager freezing? Eugenio Cuevas Your Spring/JUnit is starting the database in in-process mode. Your options would be: Either starting hsqldb in server mode Or starting the

HSQLDB and .lobs file size

那年仲夏 提交于 2019-12-05 09:34:08
I'm using a HSQLDB database in Java which stores files in a column defined as a BLOB. When I add a table row with a file/BLOB to my table the .lobs file increases in size of the file/BLOB. When I add another file to my table it increases in size again (2 x BLOB size). So, I implemented a test method which iterates 10 times and writes the same file to my table and deletes it right after the insert. Now, my .lobs file is 10 x file size... even though I've deleted all the table rows which contained the file. I've tried to execute CHECKPOINT DEFRAG but nothing happens. The .lobs file stay the same

How to access ODB files in Python 2.7

旧时模样 提交于 2019-12-05 07:31:36
I want to access an ODB file (made with LibreOffice Base) in Python and extract a table for further use. The ODB contains several tables, one relation design and several forms. Is it possible to achieve this without using any SQL? Edit: Since it seems overcomplicated to parse this format on my own, i'll consider using a proper HSQLDB engine. What python module accesses via HSQL (like sqlite3 for SQLite does)? Boud You can consider Python Uno API that comes with OpenOffice. There are several Python examples to interact with the API, including one with the sample database There is also this SO

Using HSQLDB in production environments

折月煮酒 提交于 2019-12-05 04:19:40
I want to use HSQLDB in a production environment for stroring some data in memory and for data export using files. Does anybody have experience with using hsqldb in production environments? Is hsqldb treating server resources gracefully and does it cleanup unused resources properly? I've seen a critical post on those issues from red hat and I'm wondering whether this still holds for hsqldb: http://kbase.redhat.com/faq/docs/DOC-15194 I've used hsql on numerous occasions in production (mainly as quick filebased storage for complex preferences) and never encountered any problems. Don't know about

Best way to create schema in embedded HSQL database

China☆狼群 提交于 2019-12-05 03:26:25
I'm currently using the following setup to create a schema in an embedded database before running my tests against it In my application context <jdbc:embedded-database id="dataSource" type="HSQL"> <jdbc:script location="classpath:createSchema.sql" /> </jdbc:embedded-database> createSchema.sql create schema ST_TEST AUTHORIZATION DBA; hibernate properties <properties> <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect" /> <property name="hibernate.default_schema" value="ST_TEST"/> <property name="hibernate.hbm2ddl.auto" value="create-drop" /> <property name="hibernate

What to do to make the HSQL driver working?

前提是你 提交于 2019-12-05 02:55:36
问题 I'm currently learning some database tricks in Java and I found this nice book I'm reading. At some point, it encourages me to try a manual database connection with the following class: import java.sql.DriverManager; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; public class DemoSelect { public static void main(final String[] arguments) { // Connection parameters String usr = "sa"; String pwd = ""; String driver = "org.hsqldb.jdbcDriver"; String url

How to create table if not exists with HSQLDB

梦想与她 提交于 2019-12-05 00:54:26
I'm using HSQLDB for persisting a small data, in my query I want to create tables at first time and if they are not exist anymore. However with HSQLDB I cannot execute the query "CREATE TABLE XYS IF NOT EXISTS" like other dbms like mysql or mssql. Please give me solution for this case. HSQLDB supports the syntax like the example below: CREATE TABLE IF NOT EXISTS xyx (a int, b varchar(10)) The syntax is supported by recent HSQLDB 2.3.X versions. 来源: https://stackoverflow.com/questions/21814489/how-to-create-table-if-not-exists-with-hsqldb

hsqldb快速入门

耗尽温柔 提交于 2019-12-05 00:05:14
数据库环境配置和使用 首先从 http://www.hsqldb.org/ 下载一个 hsqldb 的稳定版本,解压后可以浏览解压目录下的 index.html ,它描述了各个目录所包含内容,在 doc 段里有一个重要的链接 User Guide: index.html ,有空好好研究吧! 数据库实例创建 在 hsqldb 的管理中,如果启动的数据库文件不存在,就新建该数据库文件。 Hsldb 启动 Hsqldb 的启动模式有三种主要模式,其他参见 User Guide : l Server 该模式就像启动 mysql 、 oracle 等数据库一样,数据库启动后作为一个服务存在,其他数据库工具可以通过 jdbc 的方式访问他,这是我们最熟悉的模式。启动脚本如下: java -cp hsqldb.jar org.hsqldb.Server -database.0 ./db/test -dbname.0 test 后面参数: -database.n 数据库文件(其他数据库中对应:数据库实例)地址,支持相对路径,注意使用反斜杠 -dbname.n 数据库文件的访问同义词,就是用这个名称访问数据库的 server 模式 jdbc 访问方式: Connection c = DriverManager.getConnection("jdbc:hsqldb:hsql://localhost

hsqldb安装部署

别等时光非礼了梦想. 提交于 2019-12-05 00:05:02
hdqldb 环境:Windows 2008 r2 获取包: 官网:http://hsqldb.org/ 解压启动: 在c盘创建hsqldb目录,把压缩包解压至此目录 如图会有一个bin目录和data目录 进入data目录 创建server.properties文件 内容如下: server.port = 9002           #指定端口号为9001 server.database.0 = file:data/xwiki #将在data目录下创建mydb数据库 server.dbname.0 = xwiki   #指定数据库名,jdbc连接时就是用此名称 server.silent = true 进入bin目录: runServer cd ..\data @java -classpath ../lib/hsqldb.jar org.hsqldb.server.Server -port 9002 -database.0 file:../data/xwiki -dbname.0 xwiki 创建xwiki数据库,端口9002 runManager cd ..\data @java -cp ../lib/hsqldb.jar org.hsqldb.util.DatabaseManager 验证是否成功 runManagerSwing cd ..\data @java