Ask Your Question

Is Java JDBC compatible with the LibreOffice HSQL ?

asked 2018-09-11 12:46:26 +0100

len gravatar image

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?

edit retag flag offensive close merge delete



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).

Ratslinger gravatar imageRatslinger ( 2018-09-11 16:26:07 +0100 )edit
antropoide gravatar imageantropoide ( 2018-09-12 11:50:31 +0100 )edit

1 Answer

Sort by » oldest newest most voted

answered 2018-09-14 05:42:23 +0100

len gravatar image

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.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-09-11 12:46:26 +0100

Seen: 37 times

Last updated: Sep 14