jdcb-HSQLDB: DriverManager.getConnection hangs



Hello,

I'm trying to get the hsqldb with jdcb driver working but have some troubles with it. It works perfectly to create a new database and to insert a lot of data. In my case I inserted about 1mio lines of simple information. After closing my application and opening again the application hangs in this line (I waited about 5 minutes):

Connection cn = DriverManager.getConnection("jdbc:hsqldb:file:test5", "sa", "");

Here is my simple-sample-code:

Connection cn = DriverManager.getConnection("jdbc:hsqldb:file:test5", "sa", "");
Statement st = cn.createStatement();
ResultSet ts = null;
st.executeQuery("CREATE CACHED TABLE xx ( i INTEGER, s VARCHAR, d DATE )");
for (int i=0;i<1000000;i++)
{
if ((i % 10000) == 0)
{
st.executeQuery("commit");
}
ts = st.executeQuery("INSERT INTO xx VALUES ( "+i+", 'abcABC', '2004-01-01' )");
}
st.executeQuery("commit");
st.executeQuery("shutdown");
st.close();
ts.close();
cn.close();


Can anyone give me help on this, pls?


--
Mfg
Thomas Pototschnig
www.oxed.de
.



Relevant Pages

  • Re: Firebird, Microsoft Express, Postgre, or Virtuoso?
    ... For production, I may need something embedded, residing in memory ... managing a Sybase enterprise database (with ... than HSQLDB currently. ...
    (comp.databases)
  • Re: a database for free
    ... I want to use a free database for my project.For my application to run ... my customer also needs the database.I am using ... HSQLDB is Open Source and free to use in any commercial product so long as the terms of the Licenses are met. ...
    (comp.lang.java.databases)
  • Re: changing db schemas after application deployment
    ... I'm developing a swing based App, at the moment during development i'm switching between using mySql & hsqldb as my database for the app ... Anyway I started to think about what happens in the future when hopefully I have a user base and make changes to my application which require changes to the database. ... Say for example I add a new column to one of my tables, well I suppose in the startup code I can check for the existance of that particular column and create it if it isnt there already. ... It would make my life eaiser in the sense each time I make a change to my database using mysql I also have to make the change to hsqldb, recopy the hsqldb to my directoy used by my installer generator blah blah when really if the change is made once in my startup procedure then it doesnt matter what db I'm using. ...
    (comp.lang.java.databases)
  • Re: Searching for a database to replace Access
    ... I used HSQLDB and I noticed it is slow and little buggy for some databases ... MySQL is AFAIK not fully SQL2 compliant. ... > - not really a robust database system, ... > + free, open source, embeddable? ...
    (comp.lang.java.databases)
  • Re: changing db schemas after application deployment
    ... I'm developing a swing based App, at the moment during development i'm switching between using mySql & hsqldb as my database for the app ... Anyway I started to think about what happens in the future when hopefully I have a user base and make changes to my application which require changes to the database. ... Say for example I add a new column to one of my tables, well I suppose in the startup code I can check for the existance of that particular column and create it if it isnt there already. ...
    (comp.lang.java.databases)