hsqldb

Database lock acquisition failure and hsqldb

烈酒焚心 提交于 2019-12-03 16:16:26
问题 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

100% in-memory HSQL database

风流意气都作罢 提交于 2019-12-03 15:49:36
I have a Java application set up as a service to do data-mining against ~3GB of data every few hours. I would like this to occur 100% in memory. Ideally I want the application to be isolated from everything; I want it to construct the database, do the mining I need, and tear down the database when it's done. However with HSQLDB, even when i use the "create memory table...." command, a log is written of all of the statements and the table is recreated the next time the application runs. I'm doing a LOT of inserts, ~150k+, so this file will quickly grow in size. I also don't care about

Using @Table with schema name in Hibernate 3.3.1ga and HSQLDB

安稳与你 提交于 2019-12-03 14:41:37
How can I make this work in unit tests using Hibernate 3.3.1ga and HSQLDB: @Entity @Table(name="CATEGORY", schema="TEST") public static class Category { ... } The problem is that Hibernate expects the schema to exist. The second problem is that Hibernate issues the CREATE TABLE TEST.CATEGORY before any of my code runs (this happens deep inside Spring's test setup), so I can't get a connection to the DB before Hibernate and create the schema manually. But I need the schema because I have to access different databases in the real code. What should I do? Hibernate 3.3.1ga, HSQLDB, Spring 2.5 You

Turn off upper-case for table and column names in HSQL?

[亡魂溺海] 提交于 2019-12-03 13:31:27
How to turn off forced upper-case mode for table and column names in HSQL? <artifactId>hsqldb</artifactId> <version>2.3.1</version> OS: Windows 7 x64 The rules around this are explained in the HSQLDB documentation : When a database object is created with one of the CREATE statements or renamed with the ALTER statement, if the name is enclosed in double quotes, the exact name is used as the case-normal form. But if it is not enclosed in double quotes, the name is converted to uppercase and this uppercase version is stored in the database as the case-normal form. Case sensitivity rules for

How to connect to HSQL which Spring creates when jdbc:embedded-database is used?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-03 12:35:24
I have a HSQL database which Spring automatically creates for me: <jdbc:embedded-database id="dataSource" type="HSQL"> <jdbc:script location="classpath:scheme.sql" / </jdbc:embedded-database> And now I want to connect to this database. My question is how to do this, because I don't known which address I should use. This embedded HSQL database is all-in-memory and in-process, therefore accessible only from the Spring Java process. If you want to access the database from another tool as well, for example to check the contents with a database manager, you can start an HSQLDB server with an all-in

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

纵然是瞬间 提交于 2019-12-03 11:23:29
问题 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? 回答1: 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

HyperSQL (HSQLDB): massive insert performance

大兔子大兔子 提交于 2019-12-03 09:02:40
I have an application that has to insert about 13 million rows of about 10 average length strings into an embedded HSQLDB. I've been tweaking things (batch size, single threaded/multithreaded, cached/non-cached tables, MVCC transactions, log_size/no logs, regular calls to checkpoint , ...) and it still takes 7 hours on a 16 core, 12 GB machine. I chose HSQLDB because I figured I might have a substantial performance gain if I put all of those cores to good use but I'm seriously starting to doubt my decision. Can anyone show me the silver bullet? With CACHED tables, disk IO is taking most of the

HSQLDB - invalid authorization specification

匿名 (未验证) 提交于 2019-12-03 08:59:04
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I need help with an issue during the database connection via JPA/Hibernate on hsqldb-2.2.8: [AWT-EventQueue-0] ERROR org.hibernate.util.JDBCExceptionReporter - invalid authorization specification - not found: manasouza I created some user (manasouza) with some password as: CREATE USER manasouza PASSWORD 123 ADMIN I'm using SQLWorkbench as my database visualizer, and with it I can log on normally. Using JPA/Hibernate I already tried the username on uppercase and the password as '123' or as the value cryptographed showed on the PASSWORD_DIGEST

TEXT field that is compatible in mysql and hsqldb

匿名 (未验证) 提交于 2019-12-03 08:33:39
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have an application that uses a mysql database but I would like to run the unit tests for the application in a hsqldb in-memory database. The problem is that some of my persistable model objects have fields which I have annotated as columnDefinition = "TEXT" to to force mysql to cater for long string values, but now hsqldb doesn't know what TEXT means. If I change it to CLOB, then hsqldb is fine but mysql fails. Is there a standard column definition that I can use for long strings that is compatible with mysql AND hsqldb? 回答1: What worked

HSQLDB ROWNUM compatibility with Oracle

南笙酒味 提交于 2019-12-03 06:29:12
THe HSQLDB changelog states that ROWNUM() was added in v2.2.0 which I am using without any problems when running integration tests against the in-memory HSQLDB. However I want to run the same tests against a real Oracle 10g database, but the query fails because the pseudo-column is called ROWNUM . Is there an easy way write a single query string that works in both environments? The ROWNUM() function is available by default in HSQLDB 2.2.x and later. If you enable Oracle syntax compatibility mode, you can also use ROWNUM. This statement enables it: SET DATABASE SQL SYNTAX ORA TRUE Or use the