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!

Using JDBC to write to MS Excel file

843854Jan 27 2005 — edited Nov 20 2014
Hi all experts,
I am developing a program which uses the JDBC to insert records into MS *.xls files. It worked fine for reading. But when inserting: it shows the exception:

java.sql.SQLException: [Microsoft][ODBC Excel Driver] Operation must use an updateable query.

I was so confused, because I already used PreparedStatement.executeUpdate() method, the following is my code:
***************************************************************************************

String insertStmnt = "INSERT INTO [test1$] values(' ', " + "'" + result +"','')";

PreparedStatement testStmnt = testConn.prepareStatement(insertStmnt);
testStmnt.executeUpdate();
***************************************************************************************

Any one has some suggestion?
I am so worried! Coz the project is due soon!

Thanks a lot!

Michael
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 11 2008
Added on Jan 27 2005
23 comments
420 views