Knowledgebase: Others
[QODBC-Desktop] How can QODBC Driver work with the Java ODBC Bridge Product
Posted by brad waddell on 12 March 2009 05:21 PM

Note: The JDBC-ODBC bridge driver was removed in Java 8, preventing ODBC drivers from being usable in newer versions of Java or other Java-based applications.

Refer: Oracle JDBC-ODBC Bridge

An Example of QODBC Driver working with the Java ODBC Bridge Product

Note: Below are some example code from one of our happy customers:

// QuickBooks variables
Connection con =null;
Statement stmt = null;
ResultSet rs = null;

// parameters for QuickBooks database
static final String url = "jdbc:odbc:QuickBooks Data";
// "QuickBooks Data" is a System DSN that is the name of the QODBC driver
// On Windows XP it can be set up at Control Panel > Administrative Tools >
// Data Sources (ODBC)

static final String driver = "sun.jdbc.odbc.JdbcOdbcDriver";

public static void main(String[] args) throws Exception {
InsertCustomers t = new InsertCustomers();
}

public InsertCustomers() throws Exception {
try {
Class.forName(driver);
con = DriverManager.getConnection(url);
stmt = con.createStatement();
System.out.println("Querying QB customer table");
rs = stmt.executeQuery("SELECT * FROM customer");
// rest of code deleted

(181 vote(s))
Helpful
Not helpful

Comments (4)
Mike
19 November 2014 10:25 PM
This doesnt work when quickbooks is closed (Java can not auto-login). Can Intuit be talked into providing a JDBC driver?
Jack
24 November 2014 12:09 PM
Hi Mike,

Please refer:
http://support.flexquarters.com/esupport/index.php?/Knowledgebase/Article/View/2529/45/qb-begin-session-failed-error--80040408-could-not-start-quickbooks
Dan
12 December 2016 01:45 AM
Does anyone can help me with an example of connection to Java version 8? As I know this bridge jdbc:odbc is no longer supported and I can't make it work.
Jack
12 December 2016 06:34 AM
Hi Dan,

As JDBC-ODBC Bridge removed from Java version 8. You need to use JDK V 6 for using ODBC connection.
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please complete the captcha below (we use this to prevent automated submissions).