0

我正在通过 odbc 驱动程序连接 excel 文件和 java。
建立连接(并且可以正常工作)后,我想从列中获取值called Net amount 2.5%

 while(rs.next())
 {  
    String e=rs.getString("Net Amount 2.5%"); 
    JOptionPane.showMessageDialog(null,e ) 
 }

我得到的错误是column not found 在网上研究了一下后,我知道mysql不允许.列名。
请建议一个代码以从 column 获取值Net Amount 2.5%

谢谢!!

4

1 回答 1

0

A solution in that case is to use the index of the column instead of its name :

rs.getString(i)
于 2012-06-09T07:02:25.573 回答