Java SQL ResultSet Close closeResultSet(final ResultSet resultSet)

Here you can find the source of closeResultSet(final ResultSet resultSet)

Description

Close the given JDBC ResultSet and ignore any thrown exception.

License

Apache License

Parameter

Parameter Description
resultSet the JDBC ResultSet to close

Declaration

public static void closeResultSet(final ResultSet resultSet) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.sql.ResultSet;
import java.sql.SQLException;

public class Main {
    /**/*from   www  .  j  a v  a2s  .com*/
     * Close the given JDBC ResultSet and ignore any thrown exception. This is useful for typical finally blocks in
     * manual JDBC code.
     *
     * @param resultSet
     *            the JDBC ResultSet to close
     */
    public static void closeResultSet(final ResultSet resultSet) {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (final SQLException ex) {
            }
        }
    }
}

Related

  1. closeResource(Connection conn, Statement stmt, ResultSet rs)
  2. closeResources(Connection conn, Statement pstmt, ResultSet rs)
  3. closeResources(Connection conn, Statement stmt, ResultSet rs)
  4. closeResources(Connection conn2, Statement statement, ResultSet rs)
  5. closeResultAndStatement(Statement statement, ResultSet resultSet)
  6. closeResultset(ResultSet resultset)
  7. closeResultSet(ResultSet resultSet)
  8. closeResultSet(ResultSet rs)
  9. closeResultSet(ResultSet rs)