Java SQL ResultSet Close closeQuietly(Connection conn, Statement stmt, ResultSet rs)

Here you can find the source of closeQuietly(Connection conn, Statement stmt, ResultSet rs)

Description

close Quietly

License

Apache License

Declaration

private static void closeQuietly(Connection conn, Statement stmt, ResultSet rs) 

Method Source Code


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

import java.sql.*;

public class Main {
    private static void closeQuietly(Connection conn, Statement stmt, ResultSet rs) {
        if (rs != null) {
            try {
                rs.close();/*from w ww .  jav a  2  s. c  o m*/
            } catch (SQLException e) {
            }
        }
        if (stmt != null) {
            try {
                stmt.close();
            } catch (SQLException e) {
            }
        }
        if (conn != null) {
            try {
                conn.close();
            } catch (SQLException e) {
            }
        }
    }
}

Related

  1. closeCursor(Statement stmt, ResultSet rows)
  2. closeDatabaseResources(PreparedStatement prepStmt, ResultSet rs, Connection con)
  3. closeDbObjects(Connection conn, Statement stmt, ResultSet res)
  4. closeEL(ResultSet rs)
  5. closeQuietly(Connection conn, Statement stmt, ResultSet rs)
  6. closeQuietly(Connection conn, Statement stmt, ResultSet rs)
  7. closeQuietly(final ResultSet resultSet)
  8. closeQuietly(ResultSet res)
  9. closeQuietly(ResultSet resultSet)