• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

reading excel file using jdbc [help me]

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:odbc:Driver={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
 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
>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.
 
Grow a forest with seedballs and this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic