|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jplate.foundation.util.Cleanup
public final class Cleanup
Provides common cleanup code for things like streams, database connections, etc. When cleaning up, exception are silently ignored.
Modifications: $Date: 2008-12-02 12:32:45 -0500 (Tue, 02 Dec 2008) $ $Revision: 479 $ $Author: sfloess $ $HeadURL: https://jplate.svn.sourceforge.net/svnroot/jplate/trunk/src/dev/java/org/jplate/foundation/util/Cleanup.java $
Constructor Summary | |
---|---|
Cleanup()
|
Method Summary | |
---|---|
static void |
close(java.sql.Connection connection)
Close the connection, connection if it is not null. |
static void |
close(java.sql.Connection connection,
java.sql.Statement statement)
Close the connection, connection , and statement,
statement |
static void |
close(java.sql.Connection connection,
java.sql.Statement statement,
java.sql.ResultSet resultSet)
Close the connection, connection , statement,
statement |
static void |
close(java.io.InputStream inputStream)
Close the input stream, inputStream if not null. |
static void |
close(java.io.OutputStream outputStream)
Close the output stream, outputStream if not null. |
static void |
close(java.io.Reader reader)
Close the reader, reader if not null. |
static void |
close(java.sql.ResultSet resultSet)
Close the result set, resultSet if it is not null. |
static void |
close(java.sql.Statement statement)
Close the statement, statement if it is not null. |
static void |
close(java.io.Writer writer)
Close the writer, writer if not null. |
static void |
closeCommit(java.sql.Connection connection)
Close the connection, connection if it is not null. |
static void |
closeFlushed(java.io.OutputStream outputStream)
Close the output stream, outputStream if not null. |
static void |
closeFlushed(java.io.Writer writer)
Close the writer, writer if not null. |
static void |
closeRollback(java.sql.Connection connection)
Close the connection, connection if it is not null. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Cleanup()
Method Detail |
---|
public static void closeCommit(java.sql.Connection connection)
connection
if it is not null. It will
attempt to commit the connection first. Any error is silently ignored.
connection
- The connection to close.public static void closeRollback(java.sql.Connection connection)
connection
if it is not null. It will
attempt to rollback the connection first. Any error is silently ignored.
connection
- The connection to close.public static void close(java.sql.Connection connection)
connection
if it is not null. Any error
is silently ignored.
connection
- The connection to close.public static void close(java.sql.Statement statement)
statement
if it is not null. Any error
is silently ignored.
statement
- The statement to close.public static void close(java.sql.ResultSet resultSet)
resultSet
if it is not null. Any error
is silently ignored.
resultSet
- The result set to close.public static void close(java.sql.Connection connection, java.sql.Statement statement)
connection
, and statement,
statement, if not null. Any error is silently ignored.
- Parameters:
connection
- The connection to close.statement
- The statement to close.
public static void close(java.sql.Connection connection, java.sql.Statement statement, java.sql.ResultSet resultSet)
connection
, statement,
statement, and result set, resultSet
, if not null.
Any error is silently ignored.
- Parameters:
connection
- The connection to close.statement
- The statement to close.resultSet
- The result set to close.
public static void close(java.io.Reader reader)
reader
if not null. Any error is silently
ignored.
reader
- The reader set to close.public static void closeFlushed(java.io.Writer writer)
writer
if not null. All data will be flushed
first. Any error is silently ignored.
writer
- The writer set to close.public static void close(java.io.Writer writer)
writer
if not null. Any error is silently
ignored.
writer
- The writer set to close.public static void close(java.io.InputStream inputStream)
inputStream
if not null. Any error is
silently ignored.
inputStream
- The input stream set to close.public static void closeFlushed(java.io.OutputStream outputStream)
outputStream
if not null. The output
stream will be flushed first. Any error is silently ignored.
outputStream
- The output stream set to close.public static void close(java.io.OutputStream outputStream)
outputStream
if not null. Any error is
silently ignored.
outputStream
- The output stream set to close.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |