谢谢你们,但我加了,编译时报错?? "Employee.java": Error #: 360 : unreported exception: java.io.UnsupportedEncodingException; must be caught or declared to be thrown at line 31, column 30
我又遇一新问题:SQLException和Exception有什么区别? 我的程序这样的: private Vector getNextRow( ResultSet rs, ResultSetMetaData rsmd ) throws SQLException { Vector currentRow = new Vector(); for ( int i = 1; i <= rsmd.getColumnCount(); ++i ) //currentRow.addElement( rs.getString( i ) ); currentRow.addElement(new String(rs.getString( i ).getBytes("ISO8859_1"),"GBK")); / //返回一条记录 return currentRow; } 报错如下------------ "JavaOracle.java": Error #: 360 : unreported exception: java.io.UnsupportedEncodingException; must be caught or declared to be thrown at line 144, column 31
"Employee.java": Error #: 360 : unreported exception: java.io.UnsupportedEncodingException; must be caught or declared to be thrown at line 31, column 30
还有 当我存入数据的时候是不是也要 :
System.out.println(new String(rset.getString(1).getBytes("GBK"),"ISO8859_1"));
我的程序这样的: private Vector getNextRow( ResultSet rs,
ResultSetMetaData rsmd )
throws SQLException
{
Vector currentRow = new Vector();
for ( int i = 1; i <= rsmd.getColumnCount(); ++i )
//currentRow.addElement( rs.getString( i ) ); currentRow.addElement(new String(rs.getString( i ).getBytes("ISO8859_1"),"GBK")); /
//返回一条记录
return currentRow;
}
报错如下------------
"JavaOracle.java": Error #: 360 : unreported exception: java.io.UnsupportedEncodingException; must be caught or declared to be thrown at line 144, column 31