wood burning stoves 2.0*
The moose likes JDBC and the fly likes Read data from Excel??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Read data from Excel???" Watch "Read data from Excel???" New topic

Read data from Excel???

Naresh Babu

Joined: Mar 20, 2001
Posts: 29
I nedd to read data from excel using JDBC.
When i give:
Connection con = DriverManager.getConnection"Jdbc:Odbc:ExcelDSN","","");
Statement st = con.createStatement();
I am getting Exception as:java.sql.SQLException: [Microsoft][ODBC Driver Manager]
Data source name not found and no default driver specified
Please , tell me where i am doing wrong?
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Connection con = DriverManager.getConnection"Jdbc:Odbc:ExcelDSN","","");

Should be lower case:
Connection con = DriverManager.getConnection("jdbcdbc:ExcelDSN","","");
I assume ExcelDSN has been defined in ODBC.

[This message has been edited by Thomas Paul (edited March 23, 2001).]

Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Naresh Babu

Joined: Mar 20, 2001
Posts: 29
Thanks! I corrected it and now i am able to read data
from excel.But,if i try to update data using
St.executeUpdate("update [test$] set ENAME='updated' ");
where st -statement object.
I get exceptions as:Operation must be an updateable query.
Is there anything with syntax??

[This message has been edited by Naresh Babu (edited March 23, 2001).]
[This message has been edited by Naresh Babu (edited March 23, 2001).]
I agree. Here's the link: http://aspose.com/file-tools
subject: Read data from Excel???
Similar Threads
How to upload oracle data to excel
Accesing Excel data sheets through JDBC
Excel encoding / charset to read multibyte characters from java
reading excel files using jdbc odbc driver
where can I download and instal ODBC for excel