FAQ Database Discussion Community


How to change port that HSQLDB server listens on

java,network-programming,port,hsqldb
I am starting a HSQLDB server programmatically, however I am getting port conflicts when I try an run the HSQLDB server in conjunction with a web application that I am developing. I get the following error on the webapp side java.util.concurrent.ExecutionException: java.net.BindException: Address already in use: JVM_Bind & I get...

When I use hsqldb I have problems with GUI (JavaFx)

java,javafx,x11,hsqldb
I can't understand how RDB can be linked with GUI but I've checked several times. I have osgi javafx application. when I install hsqldb and use database I have strange problems: Before that I used h2 and I didn't have anything like that. And the only thing was changed is...

HSQLDB + JUnit + Hibernate: java.sql.SQLException: invalid schema name

java,hibernate,junit,hsqldb
I want to run a test with JUnit and Hibernate an in-memory database HSQLDB, but when the method is trying to commit the changes to the DB, this exception appears: (No Spring framework) Caused by: java.sql.SQLException: invalid schema name: SRH in statement [select liquidacio0_.idLiquidacion as idLiquid1_180_0_, liquidacio0_.fkEstado as fkEstado180_0_, liquidacio0_.FECHA_LIQ...

orphanRemoval working in PostgreSQL but not in hsqldb

java,hibernate,postgresql,unit-testing,hsqldb
I have Academy entity: @Entity @Table(name = "academy") public class Academy { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Column(nullable = false) private String name; @Column(nullable = false) private String address; @OneToMany(fetch = FetchType.LAZY, orphanRemoval = true, mappedBy = "parent") private List<Institute> institutes; public Academy() {} public Academy(String name, String...

reset cursor position in hsqlDB, java

java,jdbc,hsqldb
I'm using hsqlDB version 2.3.2 that I'm embedding into a small program. Everything worked fine so far, I've made a simple printer method that allows mi to print a resultset in the console: public static void printResultSet(ResultSet rs){ try { if(rs==null || rs.wasNull()) { System.out.println("#### empty result set ####"); return;...

Is it possible to use OracleDataSource for some other database except for Oracle?

java,oracle,hsqldb
What I want is to use OracleDataSource with HSQLDB database. Is it possible?

Using BLOB in DBUnit

blob,hsqldb,dbunit
I have to test a class where we are retrieving data from Oracle, from a XMLTYPE column. We are using BLOB for the casting, because the system is prepared to run in MySQL too: BLOB salePlanXmlType = (BLOB) jdsLoad.getValueCell(0, "SALEPLAN"); In DBUnit, first we are creating the tables, and then...

How to change a column name in HSQLDB when the existing name is a reserved word?

java,sql,hsqldb
I'm trying to upgrade our DB from HSQLDB 1.7 to the latest version. Unfortunately someone has named a column "Default". I can't seem to rename this column in SQL (this in 1.7 as the rename has to occur before the upgrade). I have tried escaping the column: stmt.executeUpdate("ALTER TABLE table_name...

Caused by: org.hsqldb.HsqlException: cardinality violation

java,hsqldb
I am using HSQLDB as a backend for my java application, when i am trying to call procedure in java with single record, i am able to get the resultset, but for multiple records, i am getting following exception "Caused by: org.hsqldb.HsqlException: cardinality violation" CREATE PROCEDURE get_Street(OUT c_str_col VARCHAR(50), OUT...

HSQLDB Database multiple connections

hsqldb
Is it possible to connect to a HSQL database over multiple connections? I have 2 connections using the same JDBC URL and the same hsqllib.jar and it appears I get a "new" database. I imagine each connection is initializing the database in its memory?...

Truncate schema in HSQLDB

hibernate,hsqldb
I'm using HSQLDB for my unit tests. The problem is that my project contains really many tests and dropping the whole DB and recreating it for each and every test takes a really significant amount of time. I found that new HSQLDB contains the possibility of removing data from schema...

Why throwing java.lang.IndexOutOfBoundsException when reading blob in the database hsqldb

java,blob,hsqldb
Hi. I am using the following code to write blob to database at the server side. @Override public void write(TypeHandlerContext context, ResultSet resultSet, Object value) { int column = context.getColumn(); LargeObject lo = (LargeObject)value; if(lo == null) { try { resultSet.updateNull(column); } catch(SQLException e) { throw new RuntimeException(e); } }...

HSQL + Hibernate Exception: Wrong column type: Found: double, expected: float

java,hibernate,hsqldb,hsql
I am using in-memory HSQL (HSQLDB) with Hibernate for all my unit tests, because it is very fast. I have a table with a column defined as follows: float qw; When hibernate starts, I get the following error: org.hibernate.HibernateException: Wrong column type in MyTable for column qw. Found: double, expected:...

Migration HSQLDB to MySQL using MySQL Workbench 6.2

mysql,mysql-workbench,hsqldb
I've to migrate HSQLDB to MYSQL but I don't know how to configure Workbench. I tried to follow this instruction http://dev.mysql.com/doc/workbench/en/wb-migration-overview-steps.html but I've failed. How to properely configure migration ?

HsqldbException: user lacks privilege or object not found: TABLE

java,ms-access,hsqldb
I am trying to connect to a MS Access database using hsqldb in java. I added all the libraries I needed, but in the end I still get an exception: Exception in thread "main" java.sql.SQLSyntaxErrorException: user lacks privilege or object not found: MESSAGES Caused by: org.hsqldb.HsqlException: user lacks privilege or...

Error statment creation N tables DBUnit + HsqlDb (v. 2.3.2)

testing,jdbc,hsqldb,dbunit
I'm using DBUnit + hsqlDB for database unit testing. Until now, we used hsqldb version 1.8.0.10. <dependency> <groupId>org.hsqldb</groupId> <artifactId>hsqldb</artifactId> <version>1.8.0.10</version> <scope>test</scope> </dependency> We've some scripts to create the database schema (which create multiple tables). We load + execute these scripts through PreparedStatement. Something basicaly like that: @Test public void testMultipleTablesError()...

Java: ucanaccess hsqldb java.lang.NoSuchMethodError:

java,eclipse,hsqldb,ucanaccess
I downloaded and installed the uCanAccess jars by following instructions from here: Manipulating an Access database from Java without ODBC I'm learning how to use the microsoft access db for java and this is the coding I used package Main.Net; import java.sql.*; public class DataBase { Connection con; Statement st;...

Error in Script File If I Restart Identifyer Column After Insert

java,hsqldb
Is it possible to restart the ID column of an HSQLDB after rows were inserted? Can I even set it to restart at a value lower than existing IDs in the table? The Situation I have a simple Java program which connects to a HSQLDB like so: DriverManager.getConnection("jdbc:hsqldb:file:" + hsqldbPath,...

hsqldb 2.3.2 jdbc driver does not support ResultSet.first()?

java,jdbc,hsqldb
I am playing with HSQLDB+JDBC driver using JDK 8. Using rs.next() looping results works fine, however, using rs.first() does not work: feature is not supported ?! Is is by design or a bug? I plan to access hsqldb using Spring jdbc template, and I am concerned that I may stuck...

Cannot insert into hsql database with hibernate

hibernate,hsqldb
My problem is,I trying add one record into HSQL Database and I can't. Really don't know what is wrong also how to fix this.All of this is really annyoing me,cuz it's simply example and I can't run this. At the begining I run HSQLDB server with this command : java...

Hsqldb Stored Procedure

java,spring,testing,junit,hsqldb
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...

How to insert using a sequence with Liquibase

hsqldb,liquibase
I would like to do a liquibase insert with the primary key being auto generated from the sequence defined in the database. The target database is HSQLDB. It works to do an insert specifying a value for the primary key <insert ...> <column name="TAG_ID" valueNumeric="2"/> I found this (admittedly older)...

Why do the concurrent DB connections see each others uncommitted changes though isolation is set to “read committed”?

java,transactions,hsqldb,isolation-level,transaction-isolation
I am trying to make a few tests to understand how transaction isolation levels can be used to address the various concurrency concerns. I've started with TRANSACTION_READ_COMMITED, but the simplest scenario doesn't behave the way I expect. Here's the code: try(Connection connection1 = DriverManager.getConnection(JDBC_URL, JDBC_USER, JDBC_PASSWORD)) { connection1.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED); connection1.setAutoCommit(false); try(Connection...

JDBC closing a database connection

java,sql,jdbc,hsqldb
I'm not sure how to close the database through this method of database connection, it's opens and connects successfully, I don't know if it closes when I close the GUI it's coded to import java.sql.Connection; import java.sql.DriverManager; import java.sql.Statement; import javax.swing.JOptionPane; public class Database_link { Connection connect = null; Statement...

Stored Procedure in HSQLDB. Creation through SQLTool

java,sql,hsqldb,in-memory-database,hsql
I am trying to write a stored procedure. Creating it through the SQL browser goes well but when I save it in SQL file and load it through SQLTool it fails CREATE PROCEDURE SP_GETNEXTSEQUENCE(OUT out_new_seq_no DECIMAL, IN in_seq_id DECIMAL) MODIFIES SQL DATA BEGIN ATOMIC UPDATE SEQUENCE_GENERATOR SET seq_value=seq_value+1 where seq_id=in_seq_id;...

HyperSQL (HSQLDB) explicit shared (read) lock syntax

sql,database,transactions,locking,hsqldb
According to HSQLDB documentation, there are two select-for-updating directives: FOR UPDATE FOR READ ONLY If the SQL qualifier, FOR UPDATE is used, then all the updatable columns of the result set become updatable. If a cursor is declared with FOR READ ONLY, then it is not updatable. In HSQLDB, if...