Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

conneting the microsoft excel sheet using jdbc

843859Sep 1 2008 — edited Sep 1 2008
HI all
my requirement is to connect to the excel sheet using the jdbc odbc dsn and read the worksheets and get the data.
i have created the dsn using vb scripting
so when i click on a button. a dsn is created dynamically and the same dsn is passed as parameter to the system which will call a java program

the java program will us the dsn to connect to the excel sheet to read the data.

This is working fine
the problem is sometimes the following exception is raised.

java.sql.SQLException: [Microsoft][ODBC Excel Driver] Cannot open database '(unknown)'. It may not be a database that your application recognizes, or the file may be corrupt.
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcConnection.initialize(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at com.zt.ebiz.install.client.ExcelDriver.getConnection(ExcelDriver.java:290)
at com.zt.ebiz.install.client.ExcelDriver.getHostInfo(ExcelDriver.java:337)
at com.zt.ebiz.install.client.InstallClient.executeActions(InstallClient.java:188)
at com.zt.ebiz.install.client.InstallClient.main(InstallClient.java:123)

For this we are just restarting the system.
Again it works fine.
i would like to know the cause of this problem.

please help me in this

thanks
Vijay Sunder
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 29 2008
Added on Sep 1 2008
1 comment
187 views