public abstract class SqlDC<T> extends java.lang.Object implements DataControl<T>
Implements the Object to hold, the Connection and the PreparedStatement to use but propagates all methods of the DataControl interface for concrete implementation
Adds an additional protected abstract method getObject(ResultSet) as a standardized
method to create a data Object from a given ResultSet
DataControl| Modifier and Type | Field and Description |
|---|---|
protected java.sql.Connection |
m_con |
protected T |
m_obj |
protected java.sql.PreparedStatement |
m_prep
Deprecated.
|
| Constructor and Description |
|---|
SqlDC(java.sql.Connection con,
T o)
Constructor for OracleDC which sets the Connection
to use for this DataControl and the Object on which it should
operate.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.sql.PreparedStatement |
createScrollableStatement(SqlCondition con,
java.lang.String sql)
create a Prepared ScrollabeStatemen from an
SqlCondition and Sql |
protected java.sql.PreparedStatement |
createStatement(java.lang.String sql)
create a
PreparedStatement from SQL |
protected java.sql.PreparedStatement |
createStatement(java.lang.String sql,
int options)
create a
PreparedStatement from SQL, return value |
protected abstract T |
getObject(java.sql.ResultSet rs)
Method getObject returns an instance of the Object this
DataControl was intended to service by reading out the resultset
and filling the methods of the object with the values of the individual fields
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdelete, insert, retrieve, retrieveList, updateprotected T m_obj
protected java.sql.Connection m_con
@Deprecated protected java.sql.PreparedStatement m_prep
public SqlDC(java.sql.Connection con,
T o)
con - Connection, the JDBC connection to useo - Object, the Object for which this DataControl exists.protected abstract T getObject(java.sql.ResultSet rs) throws java.sql.SQLException
This function needs to be implemented to match the specific class definition of the return Object.
rs - ResultSet, Actually a specific position in the ResultSet representing
a row in the table to be mapped to an instance of the Objectjava.sql.SQLException - if a SqlException occures.protected java.sql.PreparedStatement createStatement(java.lang.String sql)
throws java.sql.SQLException
PreparedStatement from SQLjava.sql.SQLExceptionprotected java.sql.PreparedStatement createStatement(java.lang.String sql,
int options)
throws java.sql.SQLException
PreparedStatement from SQL, return valuejava.sql.SQLExceptionprotected java.sql.PreparedStatement createScrollableStatement(SqlCondition con, java.lang.String sql) throws java.sql.SQLException
SqlCondition and Sqljava.sql.SQLException