调用next却不会出现这样的异常

解决方案 »

  1.   

    first use
    rs.next()
    rs.getXxx();
    then call
    rs.wasNull()if you want to know whether Resultset is null
    use: if(rs == null)
      

  2.   

    public boolean wasNull()
                    throws SQLExceptionReports whether the last column read had a value of SQL NULL. Note that you must first call one of the getter methods on a column to try to read its value and then call the method wasNull to see if the value read was SQL NULL. Returns:
    true if the last column value read was SQL NULL and false otherwise 
    Throws: 
    SQLException - if a database access error occurs