Java SQL ResultSet Close close(ResultSet resultSet)

Here you can find the source of close(ResultSet resultSet)

Description

Closes result set safely without throwing an exception.

License

Open Source License

Declaration

public static void close(ResultSet resultSet) 

Method Source Code


//package com.java2s;

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

public class Main {
    /**//from w w  w.  j a v a  2 s .  c om
     * Closes statement safely without throwing an exception.
     */
    public static void close(Statement statement) {
        if (statement == null) {
            return;
        }

        try {
            statement.close();
        } catch (SQLException sex) {
            // ignore
        }
    }

    /**
     * Closes result set safely without throwing an exception.
     */
    public static void close(ResultSet resultSet) {
        if (resultSet == null) {
            return;
        }
        try {
            resultSet.close();
        } catch (SQLException sex) {
            // ignore
        }
    }
}

Related

  1. close(final ResultSet rs, final Statement st)
  2. close(ResultSet _rsData, Logger _logger)
  3. close(ResultSet resultSet)
  4. close(ResultSet resultSet)
  5. close(ResultSet resultSet)
  6. close(ResultSet resultSet, CallableStatement statement, Connection connection)
  7. close(ResultSet resultSet, Statement statement, Connection connection)
  8. close(ResultSet resultSet, Statement statement, Connection connection)
  9. close(ResultSet resultSet, Statement statement, Connection connection)