hsqldb

something funny with embedded hsql

≯℡__Kan透↙ 提交于 2019-12-08 01:10:49
问题 i'm just curious about something.I'm using hsql in myproject (embedded of course).At some time i felt the need to visualize what hibernate was generating.I took a free copy of dbvisualizer. here is the hsqljdbc.properties jdbc.url=jdbc:hsqldb:file:mydb;create=true hibernate hbm2ddl.auto=create i downloaded the hsql 1.8.0_10. i did all the required procedure.i could connect and see the tables but after that changes made to the table don't seem be willing to show up.then i've tried to delete

Failover support for a DB

倾然丶 夕夏残阳落幕 提交于 2019-12-07 17:00:43
问题 We are currently evaluating failover support in different databases. We were earlier using HSQLDB but it seems that it does not have clustering/replication support. Our requirement is simply to have two database servers, one being only for synchronous backup but if the primary server is down, then the secondary should automatically start acting as the primary server. Has anyone evaluated MySQL, PostgreSQL or any other DB server for such a use case? Edit: We had thought of using MySQL cluster

Auto-incrementation with HSQLDB (2.2.8) + DDLUtils

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-07 16:49:26
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"> <database name="testdb"> <table name="users"> <!--

JPA - transactions not being committed

◇◆丶佛笑我妖孽 提交于 2019-12-07 15:46:37
问题 i'm working on a project in which i use JPA, Hibernate and all this stuff for the first time and i ran into problem with transactions not being committed. I use class User which looks like this: package org.tomasherman.JBTBackup.Resource.Entity; import javax.persistence.*; import java.io.Serializable; @Entity @Table(name = "users") public class User implements Serializable { @Id @GeneratedValue private int id; private String login; private String email; private String password; private int

Id generation issue with Hibernate, liquibase and hsqldb

霸气de小男生 提交于 2019-12-07 14:41:14
问题 I've created a table using liquibase: <createTable tableName="employees"> <column name="id" type="bigint"> <constraints primaryKey="true" nullable="false"/> </column> <column name="name" type="varchar(50)"> <constraints nullable="false"/> </column> </createTable> The following sql ddl query is generated: CREATE TABLE employees (id BIGINT NOT NULL, name VARCHAR(50) NOT NULL, CONSTRAINT PK_EMPLOYEES PRIMARY KEY (id)); The corresponding entity: @Entity @Table(name="employees") public class

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

给你一囗甜甜゛ 提交于 2019-12-07 12:22:46
问题 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? 回答1: Your Spring/JUnit is starting the database in

How can I create “recursive sql”

為{幸葍}努か 提交于 2019-12-07 09:05:56
问题 I want to make "link" for Example, I have a 5 posts (id: "1", id: "2", id: "3", id: "4", id: "5") and they have a sequence {id:"1", nextId:"2"}, {id:"2", nextId:"4"} , {id:"3", nextId:"0"}, {id:"4", nextId:"3"}, {id:"5", nextId:"0"}, when I search from "1", I got a result : {id:"1"}, {id:"2"}, {id:"4"}, {id:"3"} when I search from "5", I got a result : {id:"5"} How can I find All start with {id:"1"} in ANSI SQL? select s.id, s.nextId from sample s join sample ns on ns.id = s.nextId It makes

Hsqldb Stored Procedure

纵然是瞬间 提交于 2019-12-07 09:05:53
问题 I am trying to setup a stored procedure in my in memory Hsqldb database for testing purposes. The stored proc I am working from is developed in MySql so I want to set it up with HSqlDb to fit in with my testing suite I am trying to create a simplified version of the procedure but having no joy as of yet. The procedure is CREATE PROCEDURE p_recordTaskExecution(IN userTaskId INT, IN isSuccess BOOLEAN, IN statusMessage VARCHAR(2000), IN operationsPerformed INT, INOUT procedureStatus BOOLEAN)

Disable and rebuild an index in HSQLDB

為{幸葍}努か 提交于 2019-12-07 06:03:17
I would like to disable (and later rebuild) all indexes for a given table in an HSQLDB. I know this feature from SQL Server, where you can just write ALTER INDEX ALL ON MyTable DISABLE; to disable all indexes for a table and then rebuild them with ALTER INDEX ALL ON MyTable REBUILD; I am not even sure, if HSQLDB supports disabling and enabling a single index. HSQLDB does not have this feature. You can perform SHUTDOWN COMPACT to recreate all indexes on all tables. I do not think this is indeed supported. However you can drop index and then create it again. Something like this: DROP INDEX index

org.hsqldb.HsqlException: data exception: invalid character value for cast

不羁的心 提交于 2019-12-07 04:51:29
问题 I have a table in an HSQL database which has an identity(integer) column. I'd like to support querying against the column using an arbitrary string(potentially non-numeric). However, the HSQL JDBC driver tries to cast the query parameter to an integer and throws an exception. The Oracle driver seems to support this case fine. Any ideas to alter this behavior in the hsql driver? org.hsqldb:hsqldb:2.3.0 The table: CREATE TABLE some_table(id IDENTITY NOT NULL); The query: final String query =