Class DataSource<CommonAccessException extends Exception,CommonReadResultException extends Exception>

java.lang.Object
com.saperion.common.sql.DataSource<CommonAccessException,CommonReadResultException>
Type Parameters:
CommonAccessException - common type of all provided Exceptions during connection-handling and sql-execution
CommonReadResultException - common type of all used ResultReaders during executeQuery(String, ResultReader) -operations to signal business-exceptions during ResultReader.readResult(ResultSet)
Direct Known Subclasses:
SimpleDataSource

public abstract class DataSource<CommonAccessException extends Exception,CommonReadResultException extends Exception> extends Object

DataSource encapsulates a DataSource and provides simple SQL-execution-methods ( executeUpdate(String), executeQuery(String, ResultReader)) with all the necessary error treatment.

This class contains a lot of methods signaling events in its work flow or requesting for concrete Exceptions in case of an error. This way subclasses may fine-tune the logging, collecting of runtime-informations and error-reporting.

A simple implementation that can be used directly and that has no logging, no runtime-information and treats all errors as IllegalStateExceptions is SimpleDataSource. While this class is easy to use, it is still strongly recommended to write your own subclass in any real project.

Author:
agz
See Also: