Class DBUtils
java.lang.Object
org.owasp.dependencycheck.utils.DBUtils
Collection of utility methods for working with database objects.
- Author:
- Jeremy Long
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidCloses the result set capturing and ignoring any SQLExceptions that occur.static voidcloseStatement(Statement statement) Closes the given statement object ignoring any exceptions that occur.static intgetGeneratedKey(PreparedStatement statement) Returns the generated integer primary key for a newly inserted row.
-
Method Details
-
getGeneratedKey
Returns the generated integer primary key for a newly inserted row.- Parameters:
statement- a prepared statement that just executed an insert- Returns:
- a primary key
- Throws:
DatabaseException- thrown if there is an exception obtaining the key
-
closeStatement
Closes the given statement object ignoring any exceptions that occur.- Parameters:
statement- a Statement object
-
closeResultSet
Closes the result set capturing and ignoring any SQLExceptions that occur.- Parameters:
rs- a ResultSet to close
-