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?


I hardly ever use Java code, but it appears your connection is to a Base file (mydb.odb). The connection needs to be to the database itself - possibly in a sub directory as mydb (seems like a split DB default name).

Check this thread:

Thanks for antropoide comment.
Kind of disappointed that LO doesn’t support java. Now I switched to another tool (DBeaver) to create the database instead.