Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Is Java JDBC compatible with the LibreOffice HSQL ?

I created a HSQLDB file using LibreOffice Base In the Tool>Option>Advanced, the JRE class path is set to my JDK 1.7.0_80 & it is selected. The database contains a table named TABLE1.

In the Eclipse IDE, I added the hsqldb.jar (version 2.3.4 downloaded from to "Referenced Libraries" under Java Build Path. Here are codes to access the file with JDBC:

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public static void main(String[] args) {
       Connection conn = null;
        try {
            String url = "jdbc:hsqldb:file:C:/mydb.odb;default_schema=true";
            conn = DriverManager.getConnection(url, "SA", "");

        System.out.println("Connection to Hypersql has been established.");

        Statement stmt = conn.createStatement();

        ResultSet rs = stmt.executeQuery("SELECT * FROM TABLE1");

    } catch (SQLException e) {
    } finally {
        try {
            if (conn != null) {
        } catch (SQLException ex) {

When it run until the executeQuery, the SQLException "user lacks privilege or object not found: TABLE1" was thrown. Whats wrong?