throw new SQLException( "ResultSet is null." ) ;
return rs.previous() ;
}
//下移指针
public boolean next()
throws SQLException {
if( rs==null )
return rs.next() ;
//指针最上
public boolean first()
return rs.first() ;
//指针最下
public boolean last()
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] 下一页
Copyright @ 2007-2012 敏韬网(敏而好学,文韬武略--MinTao.Net)(学习笔记) Inc All Rights Reserved. 闵涛 E_mail:admin@mintao.net(欢迎提供学习资源)
鄂公网安备 42011102001154号
站长:MinTao ICP备案号:鄂ICP备11006601号-18