All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.panhongan.utils.sql.SqlUtils Maven / Gradle / Ivy

package com.github.panhongan.utils.sql;

import lombok.extern.slf4j.Slf4j;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;

/**
 * @author lalalu plus
 * @since 2017.7.10
 * @version 1.0
 */

@Slf4j
public class SqlUtils {

	public static void closeConnection(Connection conn) {
		if (conn != null) {
			try {
				conn.close();
			} catch (Exception e) {
				log.warn("", e);
			}
		}
	}

	public static void closeStatement(Statement stmt) {
		if (stmt != null) {
			try {
				stmt.close();
			} catch (Exception e) {
                log.warn("", e);
			}
		}
	}

	public static void closeResultSet(ResultSet rs) {
		if (rs != null) {
			try {
				rs.close();
			} catch (Exception e) {
                log.warn("", e);
			}
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy