Java SQL ResultSet Close close(final PreparedStatement ps, final ResultSet rs)

Here you can find the source of close(final PreparedStatement ps, final ResultSet rs)

Description

close

License

Open Source License

Declaration

static void close(final PreparedStatement ps, final ResultSet rs) 

Method Source Code


//package com.java2s;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class Main {
    static void close(final PreparedStatement ps, final ResultSet rs) {
        closePS(ps);//from   w  w  w  . ja va  2s  .c o  m
        closeRS(rs);
    }

    static void closePS(final PreparedStatement ps) {
        try {
            if (ps != null) {
                ps.close();
            }
        } catch (final SQLException ignore) {
            // ignored
        }
    }

    static void closeRS(final ResultSet rs) {
        try {
            if (rs != null) {
                rs.close();
            }
        } catch (final SQLException ignore) {
            // ignored
        }
    }
}

Related

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