|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.java.ao.DatabaseProvider
net.java.ao.db.ClientDerbyDatabaseProvider
public class ClientDerbyDatabaseProvider
| Constructor Summary | |
|---|---|
ClientDerbyDatabaseProvider(java.lang.String uri,
java.lang.String username,
java.lang.String password)
|
|
| Method Summary | |
|---|---|
protected boolean |
considerPrecision(DDLField field)
|
protected java.lang.String |
convertTypeToString(DatabaseType<?> type)
|
java.lang.Class<? extends java.sql.Driver> |
getDriverClass()
Returns the JDBC Driver class which corresponds to the database being abstracted. |
java.sql.ResultSet |
getTables(java.sql.Connection conn)
|
protected java.lang.String |
getTriggerNameForField(DDLTable table,
DDLField field)
|
java.lang.Object |
parseValue(int type,
java.lang.String value)
Parses the database-agnostic String value relevant to the specified SQL
type in int form (as defined by Types and returns
the Java value which corresponds. |
protected java.lang.String[] |
renderAlterTableChangeColumn(DDLTable table,
DDLField oldField,
DDLField field)
|
protected java.lang.String |
renderAutoIncrement()
Generates the DDL fragment required to specify an INTEGER field as auto-incremented. |
protected java.lang.String |
renderOnUpdate(DDLField field)
|
protected java.lang.String |
renderQueryLimit(Query query)
|
protected java.lang.String |
renderTriggerForField(DDLTable table,
DDLField field)
|
protected void |
setPostConnectionProperties(java.sql.Connection conn)
|
void |
setQueryResultSetProperties(java.sql.ResultSet res,
Query query)
|
void |
setQueryStatementProperties(java.sql.Statement stmt,
Query query)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ClientDerbyDatabaseProvider(java.lang.String uri,
java.lang.String username,
java.lang.String password)
| Method Detail |
|---|
public java.lang.Class<? extends java.sql.Driver> getDriverClass()
throws java.lang.ClassNotFoundException
DatabaseProviderReturns the JDBC Driver class which corresponds to the database being abstracted. This should be implemented in such a way as to initialize and register the driver with JDBC. For most drivers, this requires code in the following form:
public Class<? extends Driver> getDriverClass() {
return (Class<? extends Driver>) Class.forName("com.mysql.jdbc.Driver");
}
The following does not fire the driver's static initializer and thus will (usually) not work:
public Class<? extends Driver> getDriverClass() {
return com.mysql.jdbc.Driver.class;
}
If the driver is not on the classpath, a ClassNotFoundException
can and should be thrown (certain auto-magic configuration sections of
ActiveObjects depend upon this under certain circumstances).
getDriverClass in class DatabaseProviderjava.lang.ClassNotFoundException
protected void setPostConnectionProperties(java.sql.Connection conn)
throws java.sql.SQLException
java.sql.SQLException
public void setQueryStatementProperties(java.sql.Statement stmt,
Query query)
throws java.sql.SQLException
setQueryStatementProperties in class DatabaseProviderjava.sql.SQLException
public void setQueryResultSetProperties(java.sql.ResultSet res,
Query query)
throws java.sql.SQLException
setQueryResultSetProperties in class DatabaseProviderjava.sql.SQLException
public java.sql.ResultSet getTables(java.sql.Connection conn)
throws java.sql.SQLException
getTables in class DatabaseProviderjava.sql.SQLException
public java.lang.Object parseValue(int type,
java.lang.String value)
DatabaseProviderParses the database-agnostic String value relevant to the specified SQL
type in int form (as defined by Types and returns
the Java value which corresponds. This method is completely database-agnostic, as are
all of all of its delegate methods.
WARNING: This method is being considered for removal to another
class (perhaps TypeManager?) as it is not a database-specific function and thus
confuses the purpose of this class. Do not rely upon it heavily. (better yet, don't rely on it
at all from external code. It's not designed to be part of the public API)
parseValue in class DatabaseProvidertype - The JDBC integer type of the database field against which to parse the
value.value - The database-agnostic String value to parse into a proper Java object
with respect to the specified SQL type.protected java.lang.String renderQueryLimit(Query query)
renderQueryLimit in class DatabaseProviderprotected java.lang.String convertTypeToString(DatabaseType<?> type)
convertTypeToString in class DatabaseProviderprotected java.lang.String renderAutoIncrement()
DatabaseProviderGenerates the DDL fragment required to specify an INTEGER field as
auto-incremented. For databases which do not support such flags (which
is just about every database exception MySQL), "" is an
acceptable return value. This method should never return null
as it would cause the field rendering method to throw a NullPointerException.
This method is abstract (as opposed to the other methods which are either defined against MySQL or simply empty) because of the vast differences in rendering auto-incremented fields across different databases. Also, it seemed like a terribly good idea at the time and I haven't found a compelling reason to change it.
renderAutoIncrement in class DatabaseProviderprotected java.lang.String renderOnUpdate(DDLField field)
renderOnUpdate in class DatabaseProvider
protected java.lang.String renderTriggerForField(DDLTable table,
DDLField field)
renderTriggerForField in class DatabaseProvider
protected java.lang.String getTriggerNameForField(DDLTable table,
DDLField field)
getTriggerNameForField in class DatabaseProviderprotected boolean considerPrecision(DDLField field)
considerPrecision in class DatabaseProvider
protected java.lang.String[] renderAlterTableChangeColumn(DDLTable table,
DDLField oldField,
DDLField field)
renderAlterTableChangeColumn in class DatabaseProvider
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||