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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Trouble inserting into an excel sheet using jdbc

843859Aug 26 2008 — edited Aug 26 2008
I'm trying to access an excel file using jdbc. doing it first time and things aren't working good.

When the excel file is closed, changes made to it are not reflected.. while if the file is open, it is updated when i run the code.
Besides, a few columns are not inserted into. For a few of them, an SQLException is thrown and "Data type mismatch in criteria expression." is reported. while in others.. it simply reports a syntax error.

My excel sheet has the following columns -
date , debit, credit, desc, total, balance

It shows a syntax error when i insert into date. i used a prepared statement and tried a setInt, setString, setDate for the column. none worked.

It reports a Data type mismatch error when i insert a string in to debit. that is.. when i do a setString.

I tried getting the ResultSetMetaData and got the column types. All columns returned varchar. i don't understand why it would report any type mismatch. how does it determine datatype for cols already existing in the excel sheet?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 23 2008
Added on Aug 26 2008
1 comment
107 views