Linux.com

Author Message
Joined: Jan 08, 2009
Posts: 1
Other Topics
Posted Jan 08, 2009 at 2:12:00 PM
Subject: Accessing Databases with JDBC
I 'ave worked through "SAMS TEACH YOURSELF JAVA 6 in 21 Days" in Windows XP environment + MS Access I am now going through in UBUNTU 8.10 using Eclipse 3.2 + IcedTea 6 JDK, with Open Office 3.0 Chapter [day] 18 see topic subject I 'ave exported relevant Tables into OO3.database using MDB-tools GUI [b]I need to create a JDBC-ODBC Bridge [/b] import java.sql.*; public class CoalReporter { public static void main(String[] arguments) { String data = "jdbc:odbc:WorldEnergy"; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection conn = DriverManager.getConnection( data, "", ""); Statement st = conn.createStatement(); ResultSet rec = st.executeQuery( "SELECT * " + etc [i]I have tried hsqldb.jar and altered code but no joy[/i] I am stumped, rest of Book works OK in 'new' environment!
Back to top Profile Email Website
Rubberman
Joined Jul 30, 2007
Posts: 944
Location:40 miles west of Chicago

Other Topics
Posted: Jan 10, 2009 8:16:21 PM
Subject: Accessing Databases with JDBC
I presume that the OO3 database is running? I don't know if it has a daemon process to connect with, or if you need to have an instance of the OO3 database executing. Sorry that I don't have more help for you - never done this with OO3 db before. What about jdbc to connect to Oracle, MySQL, or Postgres? Have you tried any of those things? Also, you might post your query on the OOo forums to get more knowledgeable help on your specific issue.

Sometimes real fast is almost as good as real time. Remember, Google is your friend!

Back to top Profile Email Website AOL Instant Messenger
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya