hsqldb

HSQLDB: Duplicate column name, unsupported internal operation: Type, invalid character for cast

点点圈 提交于 2019-12-13 03:38:13
问题 I am beginning with HSQLDB, but I hit this issue and can't figure out what's going on: CREATE TEXT TABLE ozizkaindata ( jobName VARCHAR(255) NOT NULL, buildNumber VARCHAR(255) NOT NULL, config VARCHAR(255) NOT NULL, ar VARCHAR(255) NOT NULL, arFile VARCHAR(255) NOT NULL, deployDur VARCHAR(255) NOT NULL, warmupDur VARCHAR(255) NOT NULL, scale VARCHAR(255) NOT NULL ) SELECT *, ((0.0 + warmupDur) / deployDur) AS xwarmupSlower FROM ozizkaindata ORDER BY deployDur Throws: Caused by: org.hsqldb

Simulate GROUP_CONCAT function in HSQLDB versions < 2?

微笑、不失礼 提交于 2019-12-13 02:50:08
问题 LO/OOO Base doesn't come with an HSQLDB version > 2 which means there is no GROUP_CONCAT function. Is there a way to simulate this function in HSQLDB versions < 2? Here's an example for the columns name and value before the function is applied: TIM | 51 TIM | 53 TIM | 55 JOHN | 103 JOHN | 104 I would like to use (H)SQL code in Base that returns something similar to the result of GROUP_CONCAT: TIM | 51, 53, 55 JOHN | 103, 104 (A similar question has been asked for other DBMS but the answers

HSQLDB Manage a new standalone database with ant [Table Not Found In Statement]

怎甘沉沦 提交于 2019-12-13 02:36:39
问题 I'm planning to use HSQLDB, I'm trying an example with ant. the build file: <target name="create.tables"> <echo>Creating tables using: ${db.driver} ${db.url}</echo> <sql driver="${db.driver}" url="${db.url}" userid="${db.username}" password="${db.password}" onerror="continue" src="hsqldb/create_cars.sql"> <classpath refid="hsqldb.database" /> </sql> </target> <target name="load.data"> <echo>Load Data Using: ${db.driver} ${db.url}</echo> <sql driver="${db.driver}" url="${db.url}" userid="${db

JPA HSQLDB TIMESTAMP Conversion

有些话、适合烂在心里 提交于 2019-12-13 02:17:17
问题 In our project, We are using JPA 2.1, hibernate 5.1, Spring 2.4.6, hsqldb 2.3.2. We are having a problem with our hsql query and it gives us error for localdatetime conversion. This is the error : incompatible data type in conversion: from SQL type TIMESTAMP to [B, value: instance of org.hsqldb.types.TimestampData. Here is the full stacktrace: http://pastebin.com/bhGGpvNS package calendar.model; import java.io.Serializable; import java.time.LocalDateTime; import javax.persistence.Basic;

Strange behavior of HSQLDB and group by

萝らか妹 提交于 2019-12-12 13:15:55
问题 I am using HSQLDB for writing junits and my query is like this: String queryStr = "from ManualUrlBatchModel where status IN(:status) group by batchUser order by creationTime"; Query query = getSession(requestType).createQuery(queryStr); query.setParameterList("status", status); I am retrieving one batch per user in the given status (depending on creation time FIFO order). It runs fine for end to end testing but fails while writing junits. Exception says: Caused by: java.sql.SQLException: Not

Upserting a row into an hsqldb table using the MERGE SQL statement

浪尽此生 提交于 2019-12-12 11:41:38
问题 Did not understand from the documentation how am I supposed to use it. Say I have a row I wish to upsert into the collection, overriding any existing values , if the row is already present. I do not have the row primary key, but I do have a unique key. Can any one show me the MERGE statement that upserts such a row into an HSQLDB table? 回答1: A simple example for HSQLDB is as follows: CREATE TABLE B(ID INT UNIQUE, A_ID INT); MERGE INTO B USING (VALUES 2, 3) I (ID, A_ID) ON (B.ID=I.ID) WHEN

In Liferay with hsql: Where is the database file

百般思念 提交于 2019-12-12 11:36:52
问题 I am using Liferay with Apache Tomcat and hsql. I need to locate the database file that is used. According to hsql documentation there should be a file lportal.data in the directory data/hsql, but there isn't one. 回答1: The hibernate database consists of 4 files. The .script file contains the data as SQL, the .log that last actions that took place, the .properties the configuration and the .lck is the db lockfile. These are the database, hsql has nothing like one big .data file. All other

Hibernate: use backticks for MySQL but not for HSQL

自闭症网瘾萝莉.ら 提交于 2019-12-12 10:44:08
问题 A project I work on (which uses Java, Spring, Hibernate) recently changed from Oracle to MySQL. There are a few cases where some of the properties in the code are reserved words in MySQL, such as "release". There are a few solutions, 1) rename properties in the code and subsequent getter/setter methods, also update code that invokes those methods 2) annotate the property in the code with @Column(name="`release`"). This tells hibernate to quote the name when talking to the database. I'd prefer

Hsqldb single quote character

大城市里の小女人 提交于 2019-12-12 10:07:46
问题 How can I insert single quote character to Hsqldb table? Escape character doesn't work for the problem. 回答1: There are two ways. Use two single quotes. For example INSERT INTO T VALUES 'escap''d' Use a Unicode string, which can contain a Unicode escape. For example INSERT INTO T VALUES U&'escap\0027d' Both examples insert the string escap'd into the table. 回答2: The question is old, but I found the answer by fredt but it led me astray because it doesn't actually do what the original poster

PARTITION BY alternative in HSQLDB

只愿长相守 提交于 2019-12-12 09:59:55
问题 I would like to fire the query suggested in https://stackoverflow.com/a/3800572/2968357 on a HSQLDB database using select * such as WITH tmpTable AS ( SELECT p.* , ROW_NUMBER() OVER(PARTITION BY p.groupColumn order by p.groupColumn desc) AS rowCount FROM sourceTable p) SELECT * FROM tmpTable WHERE tmpTable.rowCount = 1 but getting the following error: Caused by: org.hsqldb.HsqlException: unexpected token: PARTITION required: ) meaning PARTITION BY is not supported. Is there a work-around for