HSQLDB connection error

Posted by user1478527 on Stack Overflow See other posts from Stack Overflow or by user1478527
Published on 2014-05-31T03:17:24Z Indexed on 2014/05/31 3:24 UTC
Read the original article Hit count: 346

Filed under:
|

I created a java program for connect the HSQLDB , the first one works well,

public final static String DRIVER = "org.hsqldb.jdbcDriver";
public final static String URL = "jdbc:hsqldb:file:F:/hsqlTest/data/db";
public final static String DBNAME = "SA";

but these are not

public final static String DRIVER = "org.hsqldb.jdbcDriver";
public final static String URL = "jdbc:hsqldb:file:C:/Program Files/tich Tools/mos tech/app/data/db/t1/t2/01/db";
public final static String DBNAME = "SA";

the error shows like this:

java.sql.SQLException: error in script file line: 1 unexpected token: ?
    at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
    at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
    at org.hsqldb.jdbc.JDBCConnection.<init>(Unknown Source)
    at org.hsqldb.jdbc.JDBCDriver.getConnection(Unknown Source)
    at org.hsqldb.jdbc.JDBCDriver.connect(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at HSQLDBManagerImp.getconn(HSQLDBManagerImp.java:48)
    at TESTHSQLDB.main(TESTHSQLDB.java:15)
Caused by: org.hsqldb.HsqlException: error in script file line: 1 unexpected token: ?
    at org.hsqldb.error.Error.error(Unknown Source)
    at org.hsqldb.scriptio.ScriptReaderText.readDDL(Unknown Source)
    at org.hsqldb.scriptio.ScriptReaderBase.readAll(Unknown Source)
    at org.hsqldb.persist.Log.processScript(Unknown Source)
    at org.hsqldb.persist.Log.open(Unknown Source)
    at org.hsqldb.persist.Logger.openPersistence(Unknown Source)
    at org.hsqldb.Database.reopen(Unknown Source)
    at org.hsqldb.Database.open(Unknown Source)
    at org.hsqldb.DatabaseManager.getDatabase(Unknown Source)
    at org.hsqldb.DatabaseManager.newSession(Unknown Source)
    ... 7 more
Caused by: org.hsqldb.HsqlException: unexpected token: ?
    at org.hsqldb.error.Error.parseError(Unknown Source)
    at org.hsqldb.ParserBase.unexpectedToken(Unknown Source)
    at org.hsqldb.ParserCommand.compilePart(Unknown Source)
    at org.hsqldb.ParserCommand.compileStatement(Unknown Source)
    at org.hsqldb.Session.compileStatement(Unknown Source)
    ... 16 more

I googled this connection question , but most of them not help much, someone says that may be the HSQLDB version problem. The dbase shut down in "SHUT COMPRESS" model. Anyone give some advice?

© Stack Overflow or respective owner

Related posts about java

Related posts about hsqldb