Java Utililty Methods SQL ResultSet Close

List of utility methods to do SQL ResultSet Close

Description

The list of methods to do SQL ResultSet Close are organized into topic(s).

Method

booleanclose(ResultSet resultSet)
Close or try to close the result set.
try {
    if (resultSet != null) {
        resultSet.close();
        return true;
} catch (SQLException e) {
return false;
...
voidclose(ResultSet resultSet)
Closes provided result set without throwing an exception.
if (resultSet == null) {
    return;
try {
    resultSet.close();
} catch (SQLException sex) {
voidclose(ResultSet resultSet)
Closes result set safely without throwing an exception.
if (resultSet == null) {
    return;
try {
    resultSet.close();
} catch (SQLException sex) {
voidclose(ResultSet resultSet)
close
try {
    resultSet.close();
} catch (SQLException e) {
voidclose(ResultSet resultSet, CallableStatement statement, Connection connection)
close
try {
    if (resultSet != null)
        close(resultSet);
    if (statement != null)
        close(statement);
    if (connection != null)
        close(connection);
} catch (Exception e) {
...
voidclose(ResultSet resultSet, Statement statement, Connection connection)
close
try {
    if (resultSet != null)
        resultSet.close();
    if (statement != null)
        statement.close();
    if (connection != null)
        connection.close();
} catch (SQLException ignored) {
...
voidclose(ResultSet resultSet, Statement statement, Connection connection)
close
if (null != resultSet) {
    try {
        resultSet.close();
    } catch (Throwable e) {
        e.printStackTrace();
if (null != statement) {
...
SQLExceptionclose(ResultSet resultSet, Statement statement, Connection connection)
Closes a JDBC result set, statement, and connection, ignoring any errors.
SQLException firstException = null;
if (resultSet != null) {
    try {
        if (statement == null) {
            statement = resultSet.getStatement();
        resultSet.close();
    } catch (SQLException e) {
...
voidclose(ResultSet rs)
Close the result set and ignores thrown SQLExceptions.
try {
    if (rs != null) {
        rs.close();
} catch (SQLException e) {
voidclose(ResultSet rs)
Method close.
if (rs != null) {
    rs.close();