Package io.jmix.reports.yarg.util.db
Class DbUtils
java.lang.Object
io.jmix.reports.yarg.util.db.DbUtils
A collection of JDBC helper methods. This class is thread safe.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidclose(Connection conn) Close aConnection, avoid closing if null.static voidClose aResultSet, avoid closing if null.static voidClose aStatement, avoid closing if null.static voidcloseQuietly(Connection conn) Close aConnection, avoid closing if null and hide any SQLExceptions that occur.static voidcloseQuietly(Connection conn, Statement stmt, ResultSet rs) Close aConnection,StatementandResultSet.static voidClose aResultSet, avoid closing if null and hide any SQLExceptions that occur.static voidcloseQuietly(Statement stmt) Close aStatement, avoid closing if null and hide any SQLExceptions that occur.
-
Method Details
-
close
Close aConnection, avoid closing if null.- Parameters:
conn- Connection to close.- Throws:
SQLException- if a database access error occurs
-
close
Close aResultSet, avoid closing if null.- Parameters:
rs- ResultSet to close.- Throws:
SQLException- if a database access error occurs
-
close
Close aStatement, avoid closing if null.- Parameters:
stmt- Statement to close.- Throws:
SQLException- if a database access error occurs
-
closeQuietly
Close aConnection, avoid closing if null and hide any SQLExceptions that occur.- Parameters:
conn- Connection to close.
-
closeQuietly
Close aConnection,StatementandResultSet. Avoid closing if null and hide any SQLExceptions that occur.- Parameters:
conn- Connection to close.stmt- Statement to close.rs- ResultSet to close.
-
closeQuietly
Close aResultSet, avoid closing if null and hide any SQLExceptions that occur.- Parameters:
rs- ResultSet to close.
-
closeQuietly
Close aStatement, avoid closing if null and hide any SQLExceptions that occur.- Parameters:
stmt- Statement to close.
-