hsqldb

Hsqldb table encoding

How do I set the character encoding for a specific table? E.g: CREATE TABLE COMMENTS ( ID INTEGER GENERATED BY DEFAULT AS IDENTITY (START WITH 0, INCREMENT BY 1) NOT NULL, TXT LONGVARCHAR, PRIMARY KEY (ID) ) By default it's encoded as ASCII but I'd rather use UTF-8 for this one table. ...

In-memory Java database that I can persist (as a single huge blob of memory)

I am looking for an in-memory relational (SQL) database for Java (something like HSQLDB), whose whole state I can serialise. wholeDatabase.serialize(outputStream); newCopyOftheDatabase.loadFrom(inputStream); Or maybe the DB only uses a byte[] that I give it on initialization: byte[] memory = new byte[10 *1024*1024]; new InMemoryDatab...

How to import data to an in-memory database?

Are there any ways to import data in databases such as MS SQL, MySQL into in-memory databases like HSQLDB, H2 etc ? ...

How to do "select current_timestamp" in hsqldb?

Oracle: select systimestamp from dual MySQL: select current_timestamp SQL Server: select current_timestamp PostgreSQL: select current_timestamp The question is, how can I get the current timestamp in HSQLDB? I use version 1.8.0.10 ...

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

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 de...

ManyToMany in Hibernate without composite keys

I am dealing with legacy database. And I am writing unit test using pojos & hibernate & HSQLDB. And I am getting the following error: 17:09:03,946 ERROR SchemaExport:349 - Attempt to define a second primary key in statement Let's say I have Post and Tag entities (and of course their tables posts and tags). And there is another table to...

Unable to re-use HSQLDB in Jetty between restarts

I'm using the maven-jetty-plugin to run a Spring application. Initially the datasource was declared inside Spring. Due to external constratins, I've moved it to JNDI. The jetty-env.xml section I use for local development is: <New id="dataSource" class="org.mortbay.jetty.plus.naming.Resource"> <Arg></Arg> <Arg>jdbc/DataSource</Arg> <A...

Creating a shared HSQLDB database

In-process HSQLDB database are not expected to be opened by others, even for file-based storage. The documentation hints that this is possible: Server Modes, Advanced Topics, but I've not yet found a URL for how to activate this behaviour. Did anyone do this so they can share how to? ...

Question about HSQL DB in memory database

I have created a memory-only server instance of hsqldb , is it possible for me to connect to this memory database from 2 clients in separate jvms ? ...

Why are my DBUnit tests consuming so much memory?

I've got a hibernate-based application which uses DBUnit for unit testing. We have an XML test database, which gets loaded up with dummy data in the setUp() of each test and deleted during the tearDown(). The problem is that I can no longer run the entire suite in an IDE (in this case, Intellij), because after about 300 tests, the heap...

Storing long strings (CLOB) in Hsqldb databases?

So here's some code: statement.executeUpdate("CREATE TABLE SomeTable(id INTEGER IDENTITY, " + "text CLOB)"); which throws an exception "Wrong data type: CLOB in statement [...]". Is there a way to store CLOBs in Hsqldb databases? The documentation says it is. Or maybe my knowledge of SQL is so rusty that I forgot how to define the...

Firebird vs HSQLDB at Java

Hi , i wanna write a small (5-6 table) desktop app in java.I wanna use Firebird 2.1. database.But i googled and see HSQLDB.I wanna make a decision between firebird and hsqldb :) So which database i have to use ? ...

Using different projection functions in Hibernate criteria API based in Dialect

I want to use a standard deviation projection in a query that Im constructing using the criteria API. I can do something simply like this public class StdDevProjection extends AggregateProjection { public StdDevProjection(String propertyName) { super("stddev", propertyName); } public Type[] getTypes(Criteria criter...

Using a full outer join in HSQLDB

Hi, Is a full outer join supported in HSQLDB. I have been trying to use it but it doesnot work. I am trying to do something like this. Query 1 pulls data from table A as key,value Query 2 pulls data from table B as Key,value Now i needed an outer join where by i will club the data between the two where the keys matched and also get ...

Creating JUnit tests for database items with auto generated keys

I have a class with a primary key that is stored in a database. When creating a new instance of the class it can either be fetched from the HSQLDB database or for items not in the database it inserts everything but the primary key and this is autogenerated and returned to the class to set the id attribute. I then have a getID() method to...

HSQLDB - hiding database structure/contents from users

I'm considering using HSQLDB in a desktop app for storing local data. From what I can see, the database is stored on disk as a number of SQL statements to create the tables, insert the data, etc. Is there a simple way I can hide this from users? I'm don't necessarily need it to be completely encrypted, etc - I'd just like to prevent th...

A quick-switch alternative for HSQLDB file mode (I need concurrent access now)

I was happily working with HSQLDB by just having my DB URL like this: jdbc:hsqldb:file:target/testdb; ...and having everything like if I was on any other network database. Then suddenly one requirement punched me direct in the head, I need another JVM instance (in the same machine) to connect to the database to generate some reports....

How to embed HSQLDB in file with Spring to a WebApp

I have a webApp whit Spring and works correctly when I use HSQLDB in server mode but in file mode it only passes the unit test. This is my data source: <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="org.hsqldb.jdbcDriver" /> <property na...

Customer management / What database is recommend?

Hello! My workmate and I are trainees and we got an exercise to realize a project. We have decided us to create a customer management in Java. Now we have to choose a database. We are able to use Oracle, MySQL, PostgreSQL, HSQLDB and of course other Open Source databases. So, what database is recommend for us? I thought Oracle is too com...

Table Not Found with Hibernate and HSQLDB

Hey Guys We're using hibernate entitymanager to map our entities through JPA. And we are using HSQLDB in-memory database for unit testing. Everything was fine until a recent refactor to the model started causing the following error: 17:55:48.516 [main] WARN o.h.util.JDBCExceptionReporter - SQL Error: -22, SQLState: S0002 17:55:48.517 ...