JAVA中ResultSet的getInt获取SQL查询结果中的Int数值

Posted on 2013-05-06 14:12  JasmineLiu  阅读(3472)  评论(0)    收藏  举报

getInt

int getInt(int columnIndex)
           throws SQLException
Retrieves the value of the designated column in the current row of this ResultSet object as an int in the Java programming language.

 

Parameters:
columnIndex - the first column is 1, the second is 2, ...
Returns:
the column value; if the value is SQL NULL, the value returned is 0
Throws:
SQLException - if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set

博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3