打印本文 打印本文 关闭窗口 关闭窗口
Linux 网络服务器构架实务之七
作者:武汉SEO闵涛  文章来源:敏韬网  点击数2450  更新时间:2009/4/22 20:46:07  文章录入:mintao  责任编辑:mintao
      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]  下一页

打印本文 打印本文 关闭窗口 关闭窗口