aspose file tools*
The moose likes JDBC 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
Bookmark "problem in reading data from Excel Sheet " Watch "problem in reading data from Excel Sheet " New topic
Author

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.


Abhishek
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
Marshal

Joined: Mar 22, 2005
Posts: 41499
    
  53
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?


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem in reading data from Excel Sheet