How to read .odb file in java using JDBC?

For .mdb files we use the following code

import java.sql.*;

class Odbctest1
{
public static void main(String args[])
{
try
{
Class.forName(“sun.jdbc.odbc.jdbcodbcDriver”);
Connection con;
con=DriverManager.getConnection(“jdbc:odbc:myDB”,"","");
Statement s=con.createStatement();
ResultSet rs;
System.out.println(“hai…\n”);
String q=“select * from “Table1"”;
rs=s.executeQuery(q);
System.out.println(“rollno\t\tname\t\tdept\t\tyear\t\taddress”);
System.out.println(”-----\t\t----\t\t----\t\t-----\t\t------");
while(rs.next())
{
System.out.print(rs.getString(1)+"\t\t");
System.out.print(rs.getString(2)+"\t\t");
System.out.print(rs.getString(3)+"\t\t");
System.out.print(rs.getString(4)+"\t\t");
System.out.println(rs.getString(5)+"\t\t");
}
}
catch(Exception e)
{
System.out.println(“Error”+e);
}
}

For .odb files we are not able to find any code for the same.

That might be because there is no code avaiable that I know of.

Is this similar to this question? can I access a Base database with java

Not possible, to my knowledge.
An ODB file is a zipped container containing hsqldb script, info, properties, and data files, along with the data itself in binary format. Your code would have to load all of that or connect all of that, to a running instance of hsqldb. In LO, when and ODB file is loaded, an included hsqldb.jar is instantiated in LO process memory - this is what allows the data to be loaded, along with any forms, reports, queries, etc, which are stored in separate folders of the ODB file and defined mainly by XML resources. So, if you can do all that, then you might be able to find a solution.

It is not working for me unfortunately, I would like to read a database created using LibreOffice base and create create-read-update-delete scripts and such.