Package com.redwood.scheduler.api.jdbc
Class Closer
- java.lang.Object
-
- com.redwood.scheduler.api.jdbc.Closer
-
public final class Closer extends Object
Utility class for closing JDBC resources.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidclose(Connection con)Close given connection, if it is null does nothing.static voidclose(Connection con, Logger logger)Close given connection, if it is null does nothing.static voidclose(PreparedStatement ps)Close given prepared statement, if it is null does nothing.static voidclose(PreparedStatement ps, Logger logger)Close given prepared statement, if it is null does nothing.static voidclose(ResultSet rs)Close given ResultSet, if it is null does nothing.static voidclose(ResultSet rs, Logger logger)Close given ResultSet, if it is null does nothing.static voidclose(Statement stmt)Close given statement, if it is null does nothing.static voidclose(Statement stmt, Logger logger)Close given statement, if it is null does nothing.
-
-
-
Method Detail
-
close
public static void close(Connection con)
Close given connection, if it is null does nothing.- Parameters:
con- Connection
-
close
public static void close(Connection con, Logger logger)
Close given connection, if it is null does nothing. Exceptions that occur when closing are logged to given logger- Parameters:
con- Connectionlogger- Logger to log to (optional)
-
close
public static void close(PreparedStatement ps)
Close given prepared statement, if it is null does nothing.- Parameters:
ps- Statement
-
close
public static void close(PreparedStatement ps, Logger logger)
Close given prepared statement, if it is null does nothing. Exceptions that occur when closing are logged to given logger- Parameters:
ps- Statementlogger- Logger to log to (optional)
-
close
public static void close(Statement stmt)
Close given statement, if it is null does nothing.- Parameters:
stmt- Statement
-
close
public static void close(Statement stmt, Logger logger)
Close given statement, if it is null does nothing. Exceptions that occur when closing are logged to given logger- Parameters:
stmt- Statementlogger- Logger to log to (optional)
-
close
public static void close(ResultSet rs)
Close given ResultSet, if it is null does nothing.- Parameters:
rs- ResultSet
-
-