int i = 0;
i = resultset.getInt("name");
if(i == 0)
{
 .........;
}

解决方案 »

  1.   

    上面的大哥~~~如果 数据库里  这个  name 项 是空的怎么办?  就是没有数据 
     那么  这个  resultset.getInt(name);  是个什么东西?
      

  2.   

    int i;
    if (resultset.getObject("name") != null) {
        i = resultset.getInt("name");
    }
      

  3.   

    getInt
    public int getInt(String columnName)
               throws SQLExceptionRetrieves the value of the designated column in the current row of this ResultSet object as an int in the Java programming language. Parameters:
    columnName - the SQL name of the column 
    Returns:
    the column value; if the value is SQL NULL, the value returned is 0 
    Throws: 
    SQLException - if a database access error occurs
      

  4.   

    谢谢大家 我准备用 那个  getObject()了~~