WebObjects 5.4.2

com.webobjects.jdbcadaptor
Class DerbyPlugIn

java.lang.Object
  extended by com.webobjects.jdbcadaptor.JDBCPlugIn
      extended by com.webobjects.jdbcadaptor.DerbyPlugIn

public class DerbyPlugIn
extends JDBCPlugIn

The Derby plugin by default only supports the embedded driver usage. You will have to set the driver classname in the connection dictionary to use the network driver

Typical connection dictionary information (for examples):
username:
password:
URL: jdbc:derby:derbyDB
(driver and plugin defaults will work)


Nested Class Summary
static class DerbyPlugIn.DerbyExpression
           
static class DerbyPlugIn.DerbySynchronizationFactory
           
 
Nested classes/interfaces inherited from class com.webobjects.jdbcadaptor.JDBCPlugIn
JDBCPlugIn.LobEntry
 
Field Summary
 
Fields inherited from class com.webobjects.jdbcadaptor.JDBCPlugIn
DefaultPlugInClassName, DefaultPlugInSuffix
 
Constructor Summary
DerbyPlugIn(JDBCAdaptor adaptor)
           
 
Method Summary
 EOSchemaSynchronizationFactory createSchemaSynchronizationFactory()
          Creates a new EOSynchronizationFactory using the plugin's response to adaptor().
 String databaseProductName()
          Returns a string identifying the database.
 String defaultDriverName()
          Returns a fully qualified name of the JDBC driver class that this plugin prefers to use.
 Class defaultExpressionClass()
          Returns the Java Class to use as the expression class.
 Object fetchBLOB(ResultSet resultset, int i, EOAttribute attribute, boolean flag)
          Fetch a BLOB.
 Object fetchCLOB(ResultSet resultset, int i, EOAttribute attribute, boolean flag)
          Fetch a CLOB.
 NSDictionary jdbcInfo()
          Returns database-specific information about the JDBC data source.
 String name()
          Returns the plugin's name.
 String primaryKeyTableCreateString(String pkTableName, EOSQLExpression getRowExpr, EOAttribute primAttribute)
          The statement for creating the primaryKeyTable can be overridden here.
 void updateLOBs(JDBCChannel channel, JDBCExpression expression, NSDictionary row, EOEntity entity)
          Update LOBs (BLOBs and CLOBs).
 
Methods inherited from class com.webobjects.jdbcadaptor.JDBCPlugIn
adaptor, assignTypeForAttribute, canDescribeStoredProcedure, connectionPropertiesForConnectionDictionary, connectionURL, createAttributeForRow, createExpressionFactory, createSynchronizationFactory, databaseInformation, expressionFactory, isDroppedConnectionException, isPseudoColumnName, jdbcTypeForUnknownExternalType, newPrimaryKeys, newPrimaryKeySelectString, plugInNameForURL, plugInValueForValue, primaryKeyLockString, primaryKeyTableName, removePlugInNameForSubprotocol, schemaNameForEntity, schemaSynchronizationFactory, setPlugInNameForSubprotocol, sqlStatementForGettingProcedureNames, sqlStatementForGettingTableNames, sqlStatementForTableNamed, storedProcedureCatalogPattern, storedProcedureNamed, storedProcedureSchemaPattern, synchronizationFactory, tableTypes, wildcardPatternForAttributes, wildcardPatternForSchema, wildcardPatternForTables
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DerbyPlugIn

public DerbyPlugIn(JDBCAdaptor adaptor)
Method Detail

defaultDriverName

public String defaultDriverName()
Description copied from class: JDBCPlugIn
Returns a fully qualified name of the JDBC driver class that this plugin prefers to use. The adaptor will attempt to load this class when making a connection. Subclasses should override.

Overrides:
defaultDriverName in class JDBCPlugIn
Returns:
JDBC driver class name

databaseProductName

public String databaseProductName()
Description copied from class: JDBCPlugIn
Returns a string identifying the database. Subclasses should override.

Overrides:
databaseProductName in class JDBCPlugIn
Returns:
a String identifying the database

name

public String name()
Description copied from class: JDBCPlugIn
Returns the plugin's name. Subclasses of JDBCPlugIn need to override this method.

Overrides:
name in class JDBCPlugIn
Returns:
The name of the receiver.

defaultExpressionClass

public Class defaultExpressionClass()
Description copied from class: JDBCPlugIn
Returns the Java Class to use as the expression class. The default is JDBCExpression. Subclasses will typically override to use their own subclass of JDBCExpression.

Overrides:
defaultExpressionClass in class JDBCPlugIn
Returns:
a Java Class (subclass of JDBCExpression)
See Also:
JDBCExpression, JDBCAdaptor.defaultExpressionClass()

jdbcInfo

public NSDictionary jdbcInfo()
Description copied from class: JDBCPlugIn
Returns database-specific information about the JDBC data source. Subclasses may want to return a modified copy of the dictionary returned by calling super.

Overrides:
jdbcInfo in class JDBCPlugIn
Returns:
an NSDictionary describing database-specific information about the JDBC data source

fetchBLOB

public Object fetchBLOB(ResultSet resultset,
                        int i,
                        EOAttribute attribute,
                        boolean flag)
                 throws SQLException
Description copied from class: JDBCPlugIn
Fetch a BLOB. This supports a database-specific way of fetching a BLOB so plugin subclasses need to override the default, which simply returns null.

Overrides:
fetchBLOB in class JDBCPlugIn
Parameters:
resultset - the current ResultSet
i - the column index corresponding to the BLOB
attribute - the attribute mapped to the BLOB
flag - a boolean that determines if the BLOB should be fully "materialized" (if true) or left as a reference (if false)
Throws:
SQLException
See Also:
JDBCPlugIn.updateLOBs(com.webobjects.jdbcadaptor.JDBCChannel, com.webobjects.jdbcadaptor.JDBCExpression, com.webobjects.foundation.NSDictionary, com.webobjects.eoaccess.EOEntity)

fetchCLOB

public Object fetchCLOB(ResultSet resultset,
                        int i,
                        EOAttribute attribute,
                        boolean flag)
                 throws SQLException
Description copied from class: JDBCPlugIn
Fetch a CLOB. This supports a database-specific way of fetching a CLOB so plugin subclasses need to override the default, which simply returns null.

Overrides:
fetchCLOB in class JDBCPlugIn
Parameters:
resultset - the current ResultSet
i - the column index corresponding to the CLOB
attribute - the attribute mapped to the CLOB
flag - a boolean that determines if the CLOB should be fully "materialized" (if true) or left as a reference (if false)
Throws:
SQLException
See Also:
JDBCPlugIn.updateLOBs(com.webobjects.jdbcadaptor.JDBCChannel, com.webobjects.jdbcadaptor.JDBCExpression, com.webobjects.foundation.NSDictionary, com.webobjects.eoaccess.EOEntity)

updateLOBs

public void updateLOBs(JDBCChannel channel,
                       JDBCExpression expression,
                       NSDictionary row,
                       EOEntity entity)
Description copied from class: JDBCPlugIn
Update LOBs (BLOBs and CLOBs). This supports a database-specific way of updating LOBs so plugin subclasses need to override the default, which does nothing. This method is called after a new row is inserted or after an existing row is updated. The plugin's JDBCExpression subclass will typically have to keep some extra bookkeeping information in order to implement this functionality.

Overrides:
updateLOBs in class JDBCPlugIn
Parameters:
channel - an open JDBCChannel
expression - the JDBCExpression used to perform the insert or update
row - an NSDictionary of the row values used in the insert or update
entity - the entity of the row that was inserted or updated
See Also:
JDBCPlugIn.fetchBLOB(java.sql.ResultSet, int, com.webobjects.eoaccess.EOAttribute, boolean), JDBCPlugIn.fetchCLOB(java.sql.ResultSet, int, com.webobjects.eoaccess.EOAttribute, boolean)

primaryKeyTableCreateString

public String primaryKeyTableCreateString(String pkTableName,
                                          EOSQLExpression getRowExpr,
                                          EOAttribute primAttribute)
Description copied from class: JDBCPlugIn
The statement for creating the primaryKeyTable can be overridden here. By default return null. CREATE TABLE (NAME CHAR(40), PK INTEGER)

Overrides:
primaryKeyTableCreateString in class JDBCPlugIn
Returns:
SQL string for creating EO_PK_TABLE

createSchemaSynchronizationFactory

public EOSchemaSynchronizationFactory createSchemaSynchronizationFactory()
Description copied from class: JDBCPlugIn
Creates a new EOSynchronizationFactory using the plugin's response to adaptor(). The default EOSynchronizationFactory supports only basic SQL table generation. Subclasses need to override this method to support schema synchronization.

Overrides:
createSchemaSynchronizationFactory in class JDBCPlugIn
Returns:
a JDBCExpressionFactory
See Also:
JDBCPlugIn.synchronizationFactory()

Last updated June 2008

Copyright © 2000-2008 Apple Inc.