0

I'm reading value from Excel using jdbc-odbc in java ? One of the column name start with . how to read the from that column ? Im getting error unknown column while reading..

//String filesend = resultset.getString(".file send");

Please help me..

user441978
  • 831
  • 9
  • 17
  • 28

2 Answers2

2

Did you try escaping the . ?
A good idea would be to see the name of the column using ResultSetMetaData.getColumnName(index) method.

Aditya Jain
  • 1,077
  • 1
  • 12
  • 25
  • yeah. once you debug to see what's the column name that resultset hold you will be able to use it in above getString() method. – Aditya Jain Dec 10 '12 at 06:16
0

May be you should use Apache POI to get connection

Here is the code:

FileInputStream myInput = new FileInputStream(inputFile);
XSSFWorkbook wb = new XSSFWorkbook(myInput);

XSSFSheet sheet = wb.getSheetAt(0);
XSSFRow row = sheet.getRow(0); 
XSSFCell cell = row.getCell(1);
cell.setCellValue(123);
Bhavik Shah
  • 5,125
  • 3
  • 23
  • 40