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.
|