Results 1 to 5 of 5
  1. #1
    atvienna is offline Member
    Join Date
    Jan 2009
    Location
    Austria
    Posts
    2
    Rep Power
    0

    Default How to access data at OpenOffice Base file (*.odb) from my java application

    I want to read data that are stored in one of my OpenOffice Base files (e.g. test.odb). Does anyone know a code?

    I searched and I got code that works with MS-Access Database files. To do the same with 'OpenOffice Base' I would need a ODBC or JDBC driver. I searched but without success.

    OpenOffice uses a Java database (HSQLDB). Is there a possibility to access the data this way?

    Thanks in advance

  2. #2
    peppem is offline Member
    Join Date
    Jan 2009
    Location
    italy
    Posts
    16
    Rep Power
    0

    Default

    Read this post:

    Java and OpenOffice BASE db EXAMPLE:

    h t t p : / / programmaremobile.blogspot.com/2009/01/java-and-openoffice-base-db-through.html]Java Article and Example: Java and OpenOffice BASE db through HSQLDB jdbc
    Article and examples about Java EE world
    http://programmaremobile.blogspot.com

  3. #3
    atvienna is offline Member
    Join Date
    Jan 2009
    Location
    Austria
    Posts
    2
    Rep Power
    0

    Smile Thank you

    Thanks a lot. It works.

  4. #4
    greihar is offline Member
    Join Date
    Jul 2010
    Posts
    1
    Rep Power
    0

    Default Problem retrieving data

    Hey there !

    I have followed the exact steps to make a connection to a *.odb file (unzip it, using hsql jdbc) but when i try to retrieve data from a table in the databa gives me this Exception

    Java Code:
    java.sql.SQLException: Table not found in statement [SELECT * FROM coleccion]
    
    java.sql.SQLException: Table not found in statement [SELECT * FROM coleccion]
            at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
            at org.hsqldb.jdbc.jdbcStatement.fetchResult(Unknown Source)
            at org.hsqldb.jdbc.jdbcStatement.executeQuery(Unknown Source)
    I have check my code twice and the table exists. If I create a new table and I insert some data into it directly from my java application I can close the application and try to select that data again and I can retrieve that information.

    The problem is that I can't retrieve data I've inserted from OpenOffice Base

  5. #5
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    5

    Default

    Quote Originally Posted by greihar View Post
    I have followed the exact steps to make a connection to a *.odb file (unzip it, using hsql jdbc) but when i try to retrieve data from a table in the databa gives me this Exception

    make sure the path to your database is ok in


    Java Code:
    String db_file_name_prefix = "C:\\temp\\\\database\\mydb";

    there is only one catch block, but try to figure out if the exception was thrown because the database was not found. and watch out, the name of the table in the sql-stmt is case sensitive.

    i followed all the steps in the url and i could read the rows from my odb.

Similar Threads

  1. error while retrieving data from data base
    By kirtesh4u in forum New To Java
    Replies: 5
    Last Post: 11-15-2008, 04:10 PM
  2. Using openoffice in java application
    By urzaaa in forum AWT / Swing
    Replies: 5
    Last Post: 08-25-2008, 01:38 PM
  3. Replies: 1
    Last Post: 08-06-2007, 05:38 PM
  4. 2 threads sharing a data base connection
    By Ed in forum Advanced Java
    Replies: 2
    Last Post: 07-04-2007, 04:41 AM
  5. Connection to data base
    By Daniel in forum JDBC
    Replies: 2
    Last Post: 06-07-2007, 04:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •