hsqldb

Disable and rebuild an index in HSQLDB

泄露秘密 提交于 2019-12-10 11:41:21
问题 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. 回答1: HSQLDB does not have this feature. You can perform SHUTDOWN COMPACT to recreate all indexes on all tables. 回答2: I do not think

Hibernate entity only one column, no name

让人想犯罪 __ 提交于 2019-12-10 11:41:01
问题 I want to map one column, without using a column name. I am using a count entity, and the want to use mulple different queries with the same entity : @Entity public class CountDTO extends Number { @Id // below causes an error in my test, hsql not same syntax @Column(name = 'COUNT') private Long count; In my prod (oracle) database I can just do select count() as COUNT from ... however, the same syntax doesn't work using hypersql in-memory db ? Is their an oracle/hsql compatible way to map a

Hibernate/JPA/HSQL : How to create a Dialect mapping for User Type ARRAY

守給你的承諾、 提交于 2019-12-10 11:38:54
问题 I have successfully created User Types with Postgres, and can read and write successfully. @org.hibernate.annotations.Type(type = "com.xxx.datamodel.ext.FooType" ) @Column(name = "foo", nullable = false) private int[] foo @org.hibernate.annotations.Type(type = "com.xxx.datamodel.ext.BarType" ) @Column(name = "bar", nullable = false) private double[] bar However, when I try to use the HSQLDialect (for unit testing) I get: Caused by: org.hibernate.MappingException: No Dialect mapping for JDBC

Relative path to hsqldb files in a web app doesn't work?

情到浓时终转凉″ 提交于 2019-12-10 11:15:36
问题 I'm using hsqldb for my Spring-based java webapp. I put database files (mydb.lck, mydb.properties,..) in src\main\java\data folder so that they're published into WEB-INF\classes\data. In datasource configuration, I specify this relative path to JVM working directory. As guided in hsqldb documents. portal.jdbc.url=jdbc:hsqldb:file:/data/mydb (Is this seperator right for Windows?) But Spring seem not find this path and insist on claiming java.sql.SQLSyntaxErrorException: user lacks privilege or

Hibernate @OneToMany throws MySQLSyntaxErrorException: You have an error in your SQL syntax

[亡魂溺海] 提交于 2019-12-10 11:01:12
问题 I try to retrieve a list with some fields from Contact and also a list of phones. For this, I'm using a query to Contacts; Also I've created a DTO with only that fields that I need. The query is: final StringBuilder query = new StringBuilder(); query.append("SELECT new com.tim.core.dto.client.MinimalContactDTO(c.id, c.version, c.name, c.title, c.email, c.createdDate, c.phones) " + " from CONTACT c "); query.append("where "); query.append("( c.localRecordStatus IS NULL "); query.append("OR c

How to fix HSQL DataSource + TxM where identity always return 0

谁都会走 提交于 2019-12-10 10:59:55
问题 I am using Hibernate to do my ORM stuff w/ HSQL for tests. It seems that a connection is fetched to do the insert and then returned. Straight after that HIbernate gets a connection then tries to fetch the identity from HSQL but that returns 0 which is obviously wrong. WHen i was running w/out a tm and datasource using a plain pooled connection everything worked but with the new tm + ds i am getting this problem. 回答1: The answer is the DataSource should be tx aware, so that connections are

HSQLDB user lacks privilege or object not found error when making select statements with where

我是研究僧i 提交于 2019-12-10 09:42:07
问题 I use SQuirrel SQL Client Version 3.5.3 and HSQLDB for my database. I have been able to specify the corresponding driver (In-memory) to it and create an Alias. I have created a table CREATE TABLE ENTRY( NAME VARCHAR(100) NOT NULL, DESC VARCHAR(500) NOT NULL, PRIMARY KEY (NAME)) and added a few lines of data into it. While statements like these work: select * from ENTRY select NAME from ENTRY select DESC from ENTRY I always get Error: user lacks privilege or object not found" when adding a

Properly transmitting and securing users' passwords for a web app

為{幸葍}努か 提交于 2019-12-10 04:24:32
问题 I'm working on a web app for my Masters project. It's a system for professors to manage student projects, and it uses Java for the server-side code, HSQLDB for the database, and JSPs for the presentation layer, and it runs on tomcat. The data that will be stored doesn't include any sensitive information (student ID, financial info, nothing like that) but usernames and passwords are a requirement, so I want to protect the passwords themselves in the event that a student uses a password for my

Need to perform ORDER by Twice

大憨熊 提交于 2019-12-10 04:17:01
问题 I want to sort according to date first and then if date is similar then according to id..How to do that in Informix/HSQL query? 回答1: SELECT FIELD1, FIELD2 FROM TABLE ORDER BY FIELD1 ASC, FIELD2 ASC A good tutorial on this SQL ORDER BY 回答2: Try this(adjusted to your needs): SELECT * FROM table ORDER BY datecol ASC, id ASC 回答3: This should work: SELECT * FROM Table ORDER BY date, id; 回答4: Does [rest of query] order by date, id work? 回答5: select * from (select * from tablename order by col1)

Best way to create schema in embedded HSQL database

ⅰ亾dé卋堺 提交于 2019-12-10 03:28:58
问题 I'm currently using the following setup to create a schema in an embedded database before running my tests against it In my application context <jdbc:embedded-database id="dataSource" type="HSQL"> <jdbc:script location="classpath:createSchema.sql" /> </jdbc:embedded-database> createSchema.sql create schema ST_TEST AUTHORIZATION DBA; hibernate properties <properties> <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect" /> <property name="hibernate.default_schema" value=