You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Mark Roth <Ma...@twosigma.com> on 2012/03/22 21:20:52 UTC

Jena SDB: HSQLDB requires VARCHAR lengths by default

Possibly something to add to the HSQLDB howto page [1], or (even better) fixing the code to provide sizes for VARCHAR when creating the table in HSQLDB:

HSQLDB requires VARCHAR size declarations by default. When  using the TableFormatter to create the table, HSQLDB will complain with the error message "length must be specified in type definition: VARCHAR". You can force HSQLDB to use a default length by setting the sql.enforce_size property to false in the JDBC URL [2].

For example, if you're using the in-memory mode of HSQLDB, you can set the JDBC URL to:

jdbc:hsqldb:mem:test;sql.enforce_size=false

Just wanted to share since this would have saved me some time.

By the way, using SDB with HSQLDB makes a great way to write unit tests.


-          Mark

[1] http://jena.sourceforge.net/DB/hsql-howto.html
[2] http://hsqldb.org/doc/2.0/guide/dbproperties-chapt.html#N14CCB

Re: Jena SDB: HSQLDB requires VARCHAR lengths by default

Posted by Andy Seaborne <an...@apache.org>.
On 22/03/12 20:20, Mark Roth wrote:

 > Possibly something to add to the HSQLDB howto page [1], or (even
 > better) fixing the code to provide sizes for VARCHAR when creating
 > the table in HSQLDB:

even better (:-), could someone please put a patch for this on JENA-401?

Ditto upgrade to a v2 HSQLDB - if there's a patch for a (tested) change, 
it'll get done.

	Andy





RE: Jena SDB: HSQLDB requires VARCHAR lengths by default

Posted by Mark Roth <Ma...@twosigma.com>.
I'm using 2.1.0 at the moment.

-----Original Message-----
From: Damian Steer [mailto:d.steer@bristol.ac.uk] 
Sent: Thursday, March 22, 2012 4:37 PM
To: jena-users@incubator.apache.org
Subject: Re: Jena SDB: HSQLDB requires VARCHAR lengths by default


On 22 Mar 2012, at 20:20, Mark Roth wrote:

> Possibly something to add to the HSQLDB howto page [1], or (even better) fixing the code to provide sizes for VARCHAR when creating the table in HSQLDB:

Which version of HSQLDB are you using? IIRC we use 1.8, but I guess it might be time to upgrade?

Damian

Re: Jena SDB: HSQLDB requires VARCHAR lengths by default

Posted by Damian Steer <d....@bristol.ac.uk>.
On 22 Mar 2012, at 20:20, Mark Roth wrote:

> Possibly something to add to the HSQLDB howto page [1], or (even better) fixing the code to provide sizes for VARCHAR when creating the table in HSQLDB:

Which version of HSQLDB are you using? IIRC we use 1.8, but I guess it might be time to upgrade?

Damian