|
SPT Core API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sptci.util.CloseJDBCResources
public class CloseJDBCResources
A convenience class to close JDBC resources in an error free manner.
Any errors encountered while closing the resources will be logged
using the logger. You can configure the location and other
properties for the logger through the logging.properties
file.
© Copyright 2007 Sans Pareil Technologies, Inc.
| Constructor Summary | |
|---|---|
CloseJDBCResources()
|
|
| Method Summary | |
|---|---|
static void |
close(Connection connection)
Utility method to close the specified Connection in
a fail-safe manner. |
static void |
close(Connection connection,
boolean autoCommit)
Utility method to close the specified Connection in
a fail-safe manner. |
static void |
close(ResultSet resultSet)
Utility method to close the specified ResultSet in
a fail-safe manner. |
static void |
close(Statement statement)
Utility method to close the specified Statement in
a fail-safe manner. |
static void |
closeAll(ResultSet resultSet)
Utility method to close the specified ResultSet in
a fail-safe manner. |
static void |
closeAll(Statement statement)
Utility method to close the specified Statement in
a fail-safe manner. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CloseJDBCResources()
| Method Detail |
|---|
public static void close(ResultSet resultSet)
ResultSet in
a fail-safe manner. Any errors encountered while closing the
result set will be logged to logger as a warning.
resultSet - The result set that is to be closed.public static void closeAll(ResultSet resultSet)
ResultSet in
a fail-safe manner. The Statement and Connection associated with the specified result set are also
closed.
resultSet - The result set that is to be closed.close( ResultSet ),
close( Statement ),
close( Connection )public static void close(Statement statement)
Statement in
a fail-safe manner. Any errors encountered while closing the
statement will be logged to logger as a warning.
statement - The statement that is to be closed.public static void closeAll(Statement statement)
Statement in
a fail-safe manner. The Connection associated with the
specified statement is also closed.
statement - The statement that is to be closed.close( Statement ),
close( Connection )public static void close(Connection connection)
Connection in
a fail-safe manner. Any errors encountered while closing the
connection will be logged to logger as a warning.
connection - The connection that is to be closed.
public static void close(Connection connection,
boolean autoCommit)
Connection in
a fail-safe manner. Set the autoCommit property of
the connection to the specified value. Any errors encountered
while closing the connection will be logged to logger as
a warning.
connection - The connection that is to be closed.autoCommit - The value to set for the autoCommit property.close( Connection )
|
SPT Core API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||