File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes problem in reading data from Excel Sheet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "problem in reading data from Excel Sheet " Watch "problem in reading data from Excel Sheet " New topic

problem in reading data from Excel Sheet

Abhishek Reddy
Ranch Hand

Joined: Mar 28, 2006
Posts: 259
My Excel sheet has a column with data value ranging from all numeric to alphanumeric. (Mixed data type). When i read this column using jdbcdbc, the datatype that i get depends on the data present in first row of this column. If first value for this col is 999, it picks up SQL data type as 8 (decimal). if it is M999, it picks SQL data type as as 12(varchar). The trouble is, whatever is the datatype, rs.getString(..) returns null whenever other type of data is encountered. Can someone suggest whats the solution for this data problem such that i always get the data present in the excel sheet. thanks.

Shivaprasad P Kanaganahallimath
Ranch Hand

Joined: Sep 25, 2006
Posts: 48
yup even i am facing the same problem. i have two datatypes one is string and another one is int. but still stuck with the problem.....

Shiva Prasad P.K.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
Using JDBC to access Excel files is kind of a hack; it's no surprise that various DB concepts don't fit in well. Could you use a better-suited API like Jakarta POI of jExcelApi?
I agree. Here's the link:
subject: problem in reading data from Excel Sheet
It's not a secret anymore!