| Home >> All |
| | safejdbc.holder.* (10) |
safejdbc: Javadoc index of package safejdbc.
Package Samples:
safejdbc.holder: This is the main package of the SafeJdbc library which provides a safe and simple object oriented wrapper around the JDBC interface.
Classes:
ConnectionProvider: A ConnectionProvider is used by the SQLExecuter class to obtain a connection. The reason why an interface is used is that there are different ways a connection can be obtained - There is the standard JDBC 1 way via Driver classes or the DriverManager, then there is the JDBC 2 way via DataSources, and then some JDBC drivers come with their own implementations of connection pooling which can be used even outside an application server. The SimpleJdbc framework can be used with any mechanism for creating and managing database connections because it creates connections only through this interface. SimpleConnectionProvider ...
SQL: This is the central abstraction of the JDBC library, it provides methods to execute SQL statements. It is implemented by SQLExecuter to provide non-transactional access to the database. Transactional access to the database is provided through a callback mechanism inside the executeTX method of SQLExecuter which passes another implementation of this interface to the TXCodeBlock. For details see the summary and the documentation of TXCodeBlock .
TxDataSourceAdapter: Some J2EE environments (e.g. BEA Weblogic 7.0) are providing DataSources with special behaviors (i.e. Connections provided by these DataSources are throwing an Exception when "commit" or "rollback" is invoked). The TxDataSourceAdapter wrapps such "special" DataSources and returns Proxy-Connections to the framework, wich are ignoring calls to "commit" or "rollback". As a rule of thumb, you should use a TxDataSourceAdapter, when transactions are managed "externaly" (e.g. by a J2EE container).
ResultSetProcessor: ResultSetProcessors are used to specify how a ResultSet should be handled. An implementation of this interface must be provided if one of the query methods of SQLExecuter (or, more generally, an implementation of the SQL interface) is called. The query method first executes the SQL string and then passes the result to the ResultSetProcessor for processing.
TXCodeBlock: All code in a TXCodeBlock is performed within a single transaction. An implementation of this interface is passed to the executeTX method of SQLExecuter. This method initializes the transaction, then calls the doTransaction method of the TXCodeBlock. Finally, it commits the transaction or - if an exception occurred - it rolls the transaction back.
LogListener: A LogListener is used by a LoggingWrapper . The LoggingWrapper will hand over all SQL-Statements to your LogListener implementation. Hence you are free to log the statements wherever you like. This way you can easily log to a file or integrate a logging framework like log4j. All you have to do is implement the log(String msg) method
SimpleConnectionProvider: This class provides JDBC connection via the JDBC 1 Driver. But this is only an example-implementation and should not be used in real-world-projects , because connections are not cached. This means every call to getConnection() is delegated to the underlying driver. The driver than creates a connection, wich is a very expensive (time consuming) operation.
ResultSetIterator: An Implementation of the ResultSetIterator interface. This convenience implementation iterates through the entire ResultSet and calls the method forEachRow for each row (pun intended :) ). While that is not the only reasonable way to handle a ResultSet, it is common enough to warrant special support as provided by this class.
FillingCommand: This interface serves to set the parameter values of a PreparedStatement SQL string which is passed to the query or update method of SQL.
BooleanHolder: This class is designed to hold a boolean. It is useful to pass a boolean into and out of a code block such as a ResultSetProcessor or a FillingCommand. For an overview see the package overview .
ObjectHolder: This class is designed to hold an object. It is useful to pass an object into and out of a code block such as a ResultSetProcessor or a FillingCommand. For an overview see the package overview .
DoubleHolder: This class is designed to hold a double. It is useful to pass a double into and out of a code block such as a ResultSetProcessor or a FillingCommand. For an overview see the package overview .
StringHolder: This class is designed to hold a string. It is useful to pass a string into and out of a code block such as a ResultSetProcessor or a FillingCommand. For an overview see the package overview .
FloatHolder: This class is designed to hold a float. It is useful to pass a float into and out of a code block such as a ResultSetProcessor or a FillingCommand. For an overview see the package overview .
ShortHolder: This class is designed to hold a short. It is useful to pass a short into and out of a code block such as a ResultSetProcessor or a FillingCommand. For an overview see the package overview .
ByteHolder: This class is designed to hold a byte. It is useful to pass a byte into and out of a code block such as a ResultSetProcessor or a FillingCommand. For an overview see the package overview .
IntHolder: This class is designed to hold an int. It is useful to pass an int into and out of a code block such as a ResultSetProcessor or a FillingCommand. For an overview see the package overview .
LongHolder: This class is designed to hold a long. It is useful to pass a long into and out of a code block such as a ResultSetProcessor or a FillingCommand. For an overview see the package overview .
CharHolder: This class is designed to hold a char. It is useful to pass a char in and out of a code block such as a ResultSetProcessor or a FillingCommand. For an overview see the package overview .
StatementProxy: This class wrapps a java.sql.Statement, so that calls to the methods execute(), executeQuery() and executeUpdate() are delegated to the LogListener.
SQLExecuter: This is probably the most important class within the SafeJDBC framework, because this class provides methods to actually access the database.
SQLExceptionHelper: This class contains much of the logic used for handling various exceptions and Throwables correctly and handling ressources accordingly.
DataSourceAdapter: This class is a Adapter for DataSources to provide the ConnectionProvider interface. It is especially usefull in an J2EE Enviornment.
SimpleConProvider: Don't use this class anymore. You should use SimpleConnectionProvider instead.
| Home | Contact Us | Privacy Policy | Terms of Service |