• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

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

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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(JdbcOdbcStatement.java:154)
at sun.jdbc.odbc.JdbcOdbcConnection.createStatement(JdbcOdbcConnection.java:420)
at sun.jdbc.odbc.JdbcOdbcConnection.createStatement(JdbcOdbcConnection.java:394)
at checkQuickBook.main(checkQuickBook.java:16)"
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.

CODE
----------------------------------------------------------------------------------------------------------------------------------
import java.sql.*;

public class checkQuickBook
{
public static void main(String args[]) throws Exception
{
String url = "jdbc dbc:myfirstlinktoquickbooks";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
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
while(rs.next())
{
System.out.println(rs.getString(1));
}
}
}
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic