| 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("jdbc dbc river={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.
|
 |
 |
|
|
subject: reading excel file using jdbc [help me]
|
|
|