| if( rs==null )
throw new SQLException( "ResultSet is null." ) ;
return rs.previous() ;
}
//下移指针
public boolean next()
throws SQLException {
if( rs==null )
throw new SQLException( "ResultSet is null." ) ;
return rs.next() ;
}
//指针最上
public boolean first()
throws SQLException {
if( rs==null )
throw new SQLException( "ResultSet is null." ) ;
return rs.first() ;
}
//指针最下
public boolean last()
throws SQLException {
if( rs==null )
throw new SQLException( "ResultSet is null." ) ;
return rs.last() ;
}
//清除变量,当你仅需要清除变量而不关库时可调用此方法
private void clear () throws SQLException {
if( rs!=null ) rs.close() ;
rs=null ;
if( stmt!=null ) stmt.close() ;
stmt=null ;
}
//清除变量并关库
public void close() throws SQLException {
clear () ;
if( conn==null )
throw new SQLException( "This connection has been closed already." ) ;
if( conn.isClosed() )
throw new SQLException( "This connection has been closed." ) ;
conn.close() ;
conn=null ;
}
}
上一页 [1] [2] [3] [4] 下一页 |