This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes reading excel file using jdbc  [help me] Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "reading excel file using jdbc  [help me]" Watch "reading excel file using jdbc  [help me]" New topic
Author

reading excel file using jdbc [help me]

vijayk kumar
Greenhorn

Joined: Jul 29, 2006
Posts: 18
hi friends,

problem:
at the time of retrieving records in excel sheet i am getting null values for the alpha numeric values in the excel sheet
example:
one of the field in excel sheet is "n38w"
while printing on the console null value appearing in the place of this field .
connection = DriverManager.getConnection("jdbcdbcriver={Microsoft Excel Driver (*.xls)};DBQ=" + fileName);


String query="Select [stock_no],[shape],[size],[color],[clarity],[rap-price],[ttl rap price],[whlrapdiscount],[ttlwhsl price],[retailrap discount],[retail price],[ttl retail price],[cert],[depth],[table],[girdle],[culet],[polish],[sym],[fluor],[crown],[pavil],[meas],[comment],[stones],[certno],[rapcode] from[Fortune Inv$]";
//[whlsprice],,, from[Fortune Inv$]";

System.out.println(rs.getString(1)); Here null value is getting
Wei Dai
Ranch Hand

Joined: Jun 22, 2005
Posts: 86
>i am getting null values for the alpha numeric values in the excel sheet
> System.out.println(rs.getString(1)); Here null value is getting
You can try rs.getInt(1). MS Excel ODBC driver has bug in detecting between numeric values and string values.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: reading excel file using jdbc [help me]
 
Similar Threads
Read Excel from JDBC.
. reading data from MS EXcel using apache poi api
Doubt on '#' in query.
JDBC
Jsp to Excel