hsqldb

How to start Transaction in JTA EntityManager

别来无恙 提交于 2019-12-25 12:03:14
问题 I have JPA mapping to HSQLDB and persistence.xml reads as below : <persistence-unit name="HMC"> <jta-data-source>java:hmc</jta-data-source> <class>org.hmc.jpa.models.BloodGroup</class> <class>org.hmc.jpa.models.ContactInfo</class> <properties> <property name=hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/> <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect" /> </properties> </persistence-unit> and get

How to start Transaction in JTA EntityManager

最后都变了- 提交于 2019-12-25 12:03:03
问题 I have JPA mapping to HSQLDB and persistence.xml reads as below : <persistence-unit name="HMC"> <jta-data-source>java:hmc</jta-data-source> <class>org.hmc.jpa.models.BloodGroup</class> <class>org.hmc.jpa.models.ContactInfo</class> <properties> <property name=hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/> <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect" /> </properties> </persistence-unit> and get

How to write hsqldb in binary form?

扶醉桌前 提交于 2019-12-25 07:34:13
问题 I'm searching a good (JDBC-compatible) replacement for SQLite in java. I've found hsqldb and it's quite satisfying me, but there are some questions. First. How it operates when database size will be 3-4GB? Still load all to RAM? Second. There said, it can support binary format, not only script. How can I enable it? Class.forName("org.hsqldb.jdbcDriver"); PleaseHsqlUseBinaryFormat(); // What should I write here or somewhere else? link = DriverManager.getConnection("jdbc:hsqldb:file:/tmp

Changin DB transaction control in flyway with hsql

空扰寡人 提交于 2019-12-25 03:14:08
问题 In HSQL to change TRANSACTION CONTROL there can't be any active transactions. Flyway, in turn, after committing migration X and before executing SQL from migration X, sets autocommitt=false and executes some of its own statements. So if the migration contains SET DATABASE TRANSACTION CONTROL statement it will wait for those uncommitted statements forever causing application to hang. (Side note: The statements executed by flyway before migration varies from version to version e.g. in 1.7 that

INNER JOIN and COUNT in the same query

自闭症网瘾萝莉.ら 提交于 2019-12-25 01:55:52
问题 I am having trouble with putting together INNER JOIN and COUNT in the same query. Tables are: TABLE STREETS ID | STREET_NAME ------------------------ 1 | Elm street 2 | Some other street 3 | Unknown street 4 | Killer street 5 | Dead-end street TABLE ACCIDENTS_STREETS STREET_ID | ACCIDENT_ID ----------------------- 2 | 4 2 | 7 2 | 2 2 | 1 5 | 3 I would like to get the street name where most accidents have occured. This is for COUNT: SELECT TOP 1 COUNT(STREET_ID) AS dangerous_street FROM

HSQLDB - how to grant privileges?

狂风中的少年 提交于 2019-12-24 17:24:10
问题 While trying to run SQL on HSQLDB I got this exception: java.sql.SQLSyntaxErrorException: user lacks privilege or object not found: ADMIN at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source) at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source) at org.hsqldb.jdbc.JDBCPreparedStatement.(Unknown Source) at org.hsqldb.jdbc.JDBCConnection.prepareStatement(Unknown Source) EDIT: That's how I'm creating the Connection object: public static Connection getConnection(){ Connection conn = null;

In Slick is there a way to declar Tables without using a Specific JDBC Driver

空扰寡人 提交于 2019-12-24 15:53:40
问题 In my persistence code all through out the tables, etc. I have the following import import scala.slick.driver.PostgresDriver.simple._ This is nice because it works, but this is a problem because all my code is bound to Postgres exclusively. If I want my production to do Postgres and my test to be HSQLDB, for example, I can't. I'd like to declare which DataSource/Driver when I'm running my persistence manager (which will do the create) instead of at the table declaration. What am I missing?

Data is not saving in MEMORY table of HSQL

南楼画角 提交于 2019-12-24 12:18:12
问题 I have created a MEMORY table in HSQL. But the data is saved and accessed only in the running of my Java application.In HSql FAQ they said that, ...the default, MEMORY tables are persistent. The data is not persistent after the program exists. What is the problem here? SQL: CREATE MEMORY TABLE SESSIONS( SESSION_DATE DATE NOT NULL, IN_TIME TIMESTAMP NOT NULL, OUT_TIME TIMESTAMP NOT NULL) Java : DriverManager.getConnection("jdbc:hsqldb:file:"+ DbConnection.class.getResource("/loginTimerDB")

error in script file line: 1 Unexpected token UNIQUE, requires COLLATION in statement [SET DATABASE UNIQUE]

走远了吗. 提交于 2019-12-24 03:17:25
问题 Whenever I connect to HSQLDB from my application deployed on eclipse Juno, it throws an exception as : java.sql.SQLException: error in script file line: 1 Unexpected token UNIQUE, requires COLLATION in statement [SET DATABASE UNIQUE] I have searched for the solution and the same problem was solved under JBoss 5.x, but I am not able to understand which version of hsqldb.jar I should replace the existing jar file with. I am working on CentOS 回答1: You need the latest version of HSQLDB jar,

How to do multiple commands one execute in the HSQLDB GUI?

老子叫甜甜 提交于 2019-12-24 01:13:26
问题 I have a number of command that I want to do from the GUI. I want to do many groups of these, but I can't get a single group to work. I presume I need to somehow force commits between them, but I can't figure out how to do that. If I execute each one of these commands by itself in order, everything works as expected. I'm using the EPSG.dat from GeoTools' EPSG.zip. unzip EPSG.zip perl -pi -e 's/readonly=true/readonly=false/' EPSG.properties java -jar hsqldb-2.4.1.jar jdbc:hsqldb:file:./EPSG