public class JdbcDaoUtils
extends java.lang.Object
Constructor and Description |
---|
JdbcDaoUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
close(java.sql.Connection conn) |
static void |
close(java.sql.Statement stmt)
Closes a JDBC
Statement while trapping and suppressing any
SQLException that may be thrown in the process. |
static int |
fetchInt(java.sql.Connection connection,
java.lang.String sql)
Retrieves the first column from the first record returned by the specified sql
query.
|
static void |
rollback(java.sql.Connection conn)
Rollback the current transaction while trapping and suppressing any
SQLException that may be thrown in the process. |
static void |
startTransaction(java.sql.Connection conn) |
public static void close(java.sql.Statement stmt)
Statement
while trapping and suppressing any
SQLException
that may be thrown in the process.stmt
- The Statement
to closepublic static void close(java.sql.Connection conn)
public static void startTransaction(java.sql.Connection conn) throws java.sql.SQLException
java.sql.SQLException
public static void rollback(java.sql.Connection conn)
SQLException
that may be thrown in the process.connection
- The JDBC connection through which the transaction takes placepublic static int fetchInt(java.sql.Connection connection, java.lang.String sql) throws java.sql.SQLException
connection
- sql
- java.sql.SQLException
Copyright © 2007-2020 EDIT. All Rights Reserved.