hsqldb

HSQLDB Statement and Java NaN doubles

烈酒焚心 提交于 2019-12-24 00:39:01
问题 I'm currently using HSQLDB to save java data. Within theses datas, there are some Double, and some of them can be of values of NaN (described as 0.0/0.0 in the javadoc). HSQLDB know how to handle these values in setDouble and setFloat of PreparedStatement . The thing is, I have to use a Statement object, not a precompiled stored procedure, and I just can't find a way to make it work. If you had the tinyest hint, it would be most welcome :) Thanks. EDIT : Here's the bunch of code I'm using :

Can HSQLDB handle a few millions of rows?

空扰寡人 提交于 2019-12-23 21:15:33
问题 I'm developing a singler user application that needs a database. Most tables will have a reasonable amount of data, but there are a few that may grow to a few millions of rows. None of my queries will return a large result set. Anyone know if HSQLDB can handle such a large number of rows? 回答1: HSQLDB can handle millions of rows. You can try some of the test classes which can create large databases. For example: http://hsqldb.org/web/hsqlPerformanceTests.html Or here: http://hsqldb.svn

SELECT FOR UPDATE in hsqldb using hibernate

时间秒杀一切 提交于 2019-12-23 18:52:16
问题 When I run a query on hsqldb (1.8.0.7) in mem mode using hibernate (4.2.3.Final) I get the following exception java.sql.SQLException: Unexpected token: FOR in statement [SELECT * FROM MYTABLE where ID=? FOR UPDATE NOWAIT] at org.hsqldb.jdbc.Util.throwError(Unknown Source) at org.hsqldb.jdbc.jdbcPreparedStatement.<init>(Unknown Source) at org.hsqldb.jdbc.jdbcConnection.prepareStatement(Unknown Source) at ... does hsqldb support select from update? 回答1: In the updatability section of the

SequenceGenerator problem with unit testing in Hsqldb/H2

核能气质少年 提交于 2019-12-23 18:24:59
问题 I have tried using both Hsqldb and H2 for unit testing but facing problem with sequence generators. Field declaration looks like this. @Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="keyword_seq") @SequenceGenerator(name="keyword_seq",sequenceName="KEYWORD_ID_SEQ", allocationSize=1) @Column(name="IM_KEYWORD_ID") private Long keywordId; When I try to test simple insert in this table in Hsqldb with following configuration, it gives error <prop key="hibernate.connection.driver

Cascading Deletes/Updates using JPA or Inside of Database?

我只是一个虾纸丫 提交于 2019-12-23 15:33:47
问题 Performance is key: Is it better to cascade deletes/updates inside of the Database or let Hibernate/JPA take care of it? Will this effect the ability to query for the data if cascades are inside of the DBMS? I am using HSQLDB if that matters. 回答1: In the case of cascading updates, you simply cannot do it in application space if you have foreign key constraints in the database. Example: say you have a lookup table for US states, with a primary key of the two-letter abbreviation. Then you have

Inspect Hsqldb Schema

雨燕双飞 提交于 2019-12-23 15:00:36
问题 Is it possible to inspect and subsequently modify an existing schema in Hsqldb standalone mode? I've tried looking at the file using the built in admin tool as well as hooking up SQuirrel SQL Client. I'm particularly interested in what primary keys exist on various tables. Is there command equivalent to MySql's 'show create table...' or 'describe '? 回答1: The sqltool \d command approximates a "describe", and primary key information is stored under the INFORMATION_SCHEMA : sql> CREATE SCHEMA

Configure MySQL db for a Spring-MVC project

两盒软妹~` 提交于 2019-12-23 02:46:14
问题 My current Database properties are as follows: I want my Database to be MySQL . Can someone please guide me how to change the properties so it gets saved in MySQL . I have installed MySQL on my Mac OSX . The Username is Root12 and password is xxx 回答1: Well, you just need to replace all the properties appropriately: the driverClassName is usually com.mysql.jdbc.Driver the url should be like jdbc:mysql://host:3306/databaseName the username and password you already have dialect depends on ORM

Hibernate or hsql does not respect column length

点点圈 提交于 2019-12-23 00:48:09
问题 I have an application that uses hibernate to generate tables (since my application is still under development) for HSQL db. In my domain model I have set @Basic @Column(name = "about", length = 10) private String about; When I open my db using DBVisualizer I can see that everything is set up properly except it is not working my column accepts values that are way over 10 characters long. When I try to run the query manually in the DBVisualier it fails as it should but hibernate lets it run.

Mapping a table called “group” in Hibernate for DB2 and HSQLDB

旧时模样 提交于 2019-12-22 10:53:56
问题 I have a table called group , that I am trying to map using hibernate for DB2 and HSQLDB. Table name group is a reserved word and it must be quoted in HSQLDB. However DB2 does not like quoted table name. So this mapping works in HSQLDB but not in DB2: @Entity @Table(name="`group`") public class Group { Mapping results in following error in DB2 (making a query that involves Group table): Caused by: com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704, SQLERRMC: SCHEMA

HSQLDB and .lobs file size

不问归期 提交于 2019-12-22 07:04:42
问题 I'm using a HSQLDB database in Java which stores files in a column defined as a BLOB. When I add a table row with a file/BLOB to my table the .lobs file increases in size of the file/BLOB. When I add another file to my table it increases in size again (2 x BLOB size). So, I implemented a test method which iterates 10 times and writes the same file to my table and deletes it right after the insert. Now, my .lobs file is 10 x file size... even though I've deleted all the table rows which