hsqldb

hsql question on data being saved

爱⌒轻易说出口 提交于 2019-12-12 09:18:10
问题 I am looking into HSQL (to embed in an app) and was expecting that the data would be saved in a myDB.data file in the filesystem Instead after a clean shutdown (execute sql "shutdown", stop and shutdown server object) the only remaining files are myDB.properties and myDB.script and myDB.script has all the commands to recreate the data in memory. No myDB.data file exists E.g. from myDB.script CREATE MEMORY TABLE PUBLIC.DUMMYTABLE(ID INTEGER PRIMARY KEY,FIRSTNAME VARCHAR(20)) From myDB

TEXT field that is compatible in mysql and hsqldb

天大地大妈咪最大 提交于 2019-12-12 08:17:51
问题 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

Add Interval to date in HSQLDB based on other column

痞子三分冷 提交于 2019-12-12 06:16:50
问题 I'm using hsqldb as in-memory database for unittests, the production system is running with mysql. The following query does work with mysql, but not if applied with hsqldb: select * from table where columnTimestamp + INTERVAL 'columnDays' DAY < now(); I want to retrieve all specific rows where the interval is based on another column. When I use fixed values it does work with hsqldb, but this is not the required behaviour. The errormessage hsqldb returns: data exception: invalid interval

HSQLDB importing a text table file into a traditional table

不打扰是莪最后的温柔 提交于 2019-12-12 05:20:01
问题 i have two the same table structure cache table (normaltable) text table (textfiletable) i want to copy data from table [2] into table [1] i'm using this insert syntax INSERT INTO normaltable ("COL1", "COL2", "COL3") SELECT COL1, COL2, COL3 FROM textfiletable; i get this error data exception:string data, right truncation/Error code: -3401/state: 22001 when using another insert syntax SELECT COL1, COL2, COL3 INTO normaltable FROM textfiletable; i get this error unexpected token : INTO required

java.lang.NoSuchMethodError: org.hsqldb.DatabaseURL.parseURL maven runtime

空扰寡人 提交于 2019-12-12 04:54:06
问题 Getting the following error. The problem is it happens intermittently when we restart our server. Sometimes the error comes and sometimes not. How to resolve this? I am using maven. java.lang.NoSuchMethodError: org.hsqldb.DatabaseURL.parseURL(Ljava/lang/String;ZZ)Lorg/hsqldb/persist/HsqlProperties; org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NoSuchMethodError: org.hsqldb.DatabaseURL.parseURL(Ljava/lang/String;ZZ)Lorg/hsqldb/persist/HsqlProperties; Edit: It's not working.

How to support support SqlServer's “..” in HyperSQL?

老子叫甜甜 提交于 2019-12-12 04:28:41
问题 tl;dr: I am trying to unit test some SqlServer queries which state the db name but they do not seem to work in HyperSql. We are using Sql Server in production and I am trying to use HyperSQL as my database for unit testing. I am trying to test a class that creates SQL queries so stubbing out the database is not an option as having the queries parsed by a real database is part of the test. Queries are supposed to be created in the form of SELECT * FROM EntAsdfDb007..Data_Table , although we

HSQLDB file mode is not working

倖福魔咒の 提交于 2019-12-12 03:26:49
问题 I am using HSQLDB with Hibernate 5 and Spring 4. I have some beans definitions in my spring-context.xml: <tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true"/> <jdbc:embedded-database id="dataSource" type="HSQL"> <jdbc:script location="classpath*:database/database_schema.sql"/> </jdbc:embedded-database> <beans:bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean"> <beans:property name="dataSource" ref="dataSource"/>

Must I set HSQLDB SA password every time whenever I restart HSQLDB server?

懵懂的女人 提交于 2019-12-12 01:47:34
问题 I started HsqlDB in server mode and set password for administrator account SA. Then I shutted down the server. Then I started the server again, but the password was gone. Must I set HSQLDB SA password again every time whenever I restart HSQLDB server? How to make the password set automatically? 回答1: The password (in latest versions, the password hash) is stored in the .script file. But you should perform CHECKPOINT after you set the password, otherwise it is may not be saved in some versions.

DbUnit Assertion floating-point numbers

我的梦境 提交于 2019-12-12 00:59:56
问题 I'm testing my DAO layer using DbUnit. I'm prefilling database from XML dataset, doing some actions and then asserting against known result. Assertion.assertEquals(expectedDataSet, actualDataSet); Dataset contains column with floating point number. Then these columns are compared, I get: junit.framework.ComparisonFailure: value (table=OrderLine_T, row=2, col=price) expected:<2.99[]> but was:<2.99[0000009536743]>. The values are equal, but because floating-point numbers cannot be exactly

Second datasource in spring application.properties for tests?

ⅰ亾dé卋堺 提交于 2019-12-11 19:44:31
问题 I have datasource defined in my application.properties as Oracle database and that's ok, the controller & repository work fine, I can persist entities and fetch database records. I have integration tests written. Before I connected my app with database I created some objects and persisted them in @PostConstruct method - and that was ok. But now, when I connected everything with database, my tests try to fetch records from the table which is pretty large. I think that's due to my application