I have a Java-Application that creates several text-tables at the first
start. When I start the application again I just want to check, if the
text tables exist. But the application always returns a "false, table
does not exist" and the localdb.properties and localdb.script files are
written new. After that, the tables can be detected, but only until the
next start of the application.
dbcon.connect(LOCALDRIVER, LOCALPROTOCOL, LOCALDATABASE, LOCALUSER,
LOCALPASS);
DatabaseMetaData metadata = dbcon.con.getMetaData();
String[] aTyps = new String[]{"TABLE"};
ResultSet result = metadata.getTables(null, null, "%", aTyps);
while (result.next()) {
System.out.println(result.getString("TABLE_NAME"));
}
result.close();
Susanne
Thomas Kellerer - 19 Dec 2006 12:58 GMT
> I have a Java-Application that creates several text-tables at the first
> start. When I start the application again I just want to check, if the
[quoted text clipped - 14 lines]
> }
> result.close();
You need to issue a SHUTDOWN statement before closing the connection to
your database. Otherwise HSQLDB does not write everything to disk.
See: http://www.hsqldb.org/doc/guide/ch01.html#N101DB
Thomas
susikaufmann2003@hotmail.com - 19 Dec 2006 13:53 GMT
> You need to issue a SHUTDOWN statement before closing the connection to
> your database. Otherwise HSQLDB does not write everything to disk.
Thank you for the fast answer. Now it works without problems :).
Susanne