Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Other Java > Java Databases
| Search | Today's Posts | Mark Forums Read
Java Databases Discussion specific to working with Java Databases. For other Java topics, please see related Java forums. For database discussions not specific to Java, please see the Database category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 5th, 2006, 05:18 AM
Registered User
 
Join Date: Mar 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default SQLException in using odbc excel driver

Hi,

I'm writing a Java http servlet that reads information from an excel file (through an odbc excel driver, which i've put on my computer both on USER DSN and SERVER DSN) and prints it out to the console screen.

I'm using JDeveloper in version 9.0.4.13.2, my excel is of year 2002 (but the odbc excel driver allows to give a version of excel 2000 at most) and the excel driver's version is 4.00.6200 .

I was able to open a connection to the excel driver through JDeveloper, but when I execute a query, I get an exception:

java.sql.SQLException: [Microsoft][ODBC Excel Driver] Optional feature not implemented.

What could be the cause of this?
Am I missing some configurations? Something in the JDEV?

This is the function which does the reading of the excel file:

private String performTask(HashMap source, ApplicationModule am) {

    try{
        // Loading the driver
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

        String dbUrl = "jdbc:odbc:" +
                               Constants.EXCEL_ODBC_NAME;
                // (the constant contains the name of
                // the odbc driver on the computer.)

        java.sql.Connection con =
                   java.sql.DriverManager.getConnection(dbUrl);
        java.sql.Statement stmnt =
                   con.createStatement
                      (java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE,
               java.sql.ResultSet.CONCUR_UPDATABLE);

        // Selecting data from file
                //(the excel file has a sheet name "sheet1")
        String query = "select * from [sheet1$]";

                // This row gives the exception:
        java.sql.ResultSet res = stmnt.executeQuery(query);
    } catch(Exception e) {

        e.printStackTrace();
    }
}

Thank you for your help,

Liron.

  #2 (permalink)  
Old December 28th, 2009, 10:27 PM
Registered User
 
Join Date: Dec 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Question java.sql.SQLException: [Microsoft][ODBC Excel Driver]

while I use the method getSchemas() of JdbcOdbcDatabaseMetaData.the Eceception is produce.I can't see the cause.
  #3 (permalink)  
Old December 20th, 2010, 08:02 AM
Registered User
 
Join Date: Dec 2010
Location: Pune, India
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up

Quote:
Originally Posted by lironnezers View Post
Hi,

I'm writing a Java http servlet that reads information from an excel file (through an odbc excel driver, which i've put on my computer both on USER DSN and SERVER DSN) and prints it out to the console screen.

I'm using JDeveloper in version 9.0.4.13.2, my excel is of year 2002 (but the odbc excel driver allows to give a version of excel 2000 at most) and the excel driver's version is 4.00.6200 .

I was able to open a connection to the excel driver through JDeveloper, but when I execute a query, I get an exception:

java.sql.SQLException: [Microsoft][ODBC Excel Driver] Optional feature not implemented.

What could be the cause of this?
Am I missing some configurations? Something in the JDEV?

This is the function which does the reading of the excel file:

private String performTask(HashMap source, ApplicationModule am) {

    try{
        // Loading the driver
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

        String dbUrl = "jdbc:odbc:" +
                               Constants.EXCEL_ODBC_NAME;
                // (the constant contains the name of
                // the odbc driver on the computer.)

        java.sql.Connection con =
                   java.sql.DriverManager.getConnection(dbUrl);
        java.sql.Statement stmnt =
                   con.createStatement
                      (java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE,
               java.sql.ResultSet.CONCUR_UPDATABLE);

        // Selecting data from file
                //(the excel file has a sheet name "sheet1")
        String query = "select * from [sheet1$]";

                // This row gives the exception:
        java.sql.ResultSet res = stmnt.executeQuery(query);
    } catch(Exception e) {

        e.printStackTrace();
    }
}

Thank you for your help,

Liron.
Hi Liron.

I found no problem in your code but for your refrence please check the following link contains JDBC-Excel Connectivity Tutorial

Regards
Tousif

Last edited by tousif_khan; December 20th, 2010 at 08:05 AM..


Similar Threads
Thread Thread Starter Forum Replies Last Post
SQLException no suitable driver zhuchunlai Apache Tomcat 2 November 29th, 2007 10:51 AM
ODBC driver creation densam ADO.NET 0 January 4th, 2006 06:00 AM
java.sql.SQLException: [Microsoft][ODBC Driver Man pvsharinath@gmail.com Java Databases 1 May 5th, 2005 02:40 AM
[ODBC Excel Driver]Syntax eror in update alinutza22 Classic ASP Professional 3 September 17th, 2004 04:00 AM
java.sql.SQLException: Error loading JDBC Driver jdphjp Java Databases 1 August 5th, 2004 12:46 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.