File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes JDBC code works with JDK1.1.8 but not with JDK1.3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "JDBC code works with JDK1.1.8 but not with JDK1.3" Watch "JDBC code works with JDK1.1.8 but not with JDK1.3" New topic

JDBC code works with JDK1.1.8 but not with JDK1.3

sunil virup

Joined: Aug 07, 2001
Posts: 5
Hello All,
I recently downloaded a ODBC driver (17th Aug 2001 release) called LinkBook for QuickBooks. The driver when used with JAVA(JDK1.1.8 ) ie accessed using JDBC-ODBC Bridge works fine and allows me to acess data stored inside .QBW files of QuickBooks.

But when I try to run the same code using JDK1.3,it throws me an exception saying

"Exception in thread "main" java.sql.SQLException: The result set type is not supported.
at sun.jdbc.odbc.JdbcOdbcStatement.initialize(
at sun.jdbc.odbc.JdbcOdbcConnection.createStatement(
at sun.jdbc.odbc.JdbcOdbcConnection.createStatement(
at checkQuickBook.main("
If any one has accessed QuickBooks .QBW files by any means using JAVA,I would like to hear from u.Kindly help me,its urgent.

here is the code that I have written.Kindly help me solve this problem.

import java.sql.*;

public class checkQuickBook
public static void main(String args[]) throws Exception
String url = "jdbc dbc:myfirstlinktoquickbooks";
Connection con = DriverManager.getConnection(url,"","");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM Budgets");//Budgets is a table in default DB that comes with QuickBooks
Nathanael Ulrick

Joined: Jul 17, 2001
Posts: 22
createStatement() can take two extra arguments: resultSetType and resultSetConcurrency.
It's probably because the default values differ between 1.1.8 and 1.3, and 1.3 is trying to create some fancy ResultSet which is scrollable etc, which the ODBC driver doesn't support.
Try specifying the arguments to something you know will be safe, e.g. TYPE_FORWARD_ONLY and CONCUR_READ_ONLY.
I agree. Here's the link:
subject: JDBC code works with JDK1.1.8 but not with JDK1.3
It's not a secret anymore!