public class JdbcUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static PreparedStatement |
buildStatement(Connection sqlConn,
String query,
String... params)
Build
PreparedStatement from parameters |
static void |
closeConnection(Connection sqlConnection)
Return connection to pool.
|
static void |
closeResultSet(ResultSet rs)
Close resultset.
|
static void |
closeStatement(PreparedStatement ps)
Utility method to close statement properly.
|
static void |
rollback(Connection sqlConn)
Utility method to perform rollback in correct way.
|
public static PreparedStatement buildStatement(Connection sqlConn, String query, String... params) throws SQLException
PreparedStatement from parametersquery - query templateparams - current parametersPreparedStatementSQLException - sql error when working with statementpublic static void closeResultSet(ResultSet rs)
rs - target resultsetpublic static void closeStatement(PreparedStatement ps)
ps - public static void closeConnection(Connection sqlConnection)
sqlConnection - public static void rollback(Connection sqlConn)
sqlConn - current sql connectionCopyright © 2013–2015 FF4J. All rights reserved.