atg.service.jdbc
Class DerbyDataSource

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.service.jdbc.FakeXADataSource
              extended by atg.service.jdbc.InitializingDataSourceBase
                  extended by atg.service.jdbc.DerbyDataSource
All Implemented Interfaces:
atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameResolver, atg.nucleus.AdminableService, atg.nucleus.logging.ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, atg.nucleus.naming.ComponentNameResolver, atg.nucleus.Service, atg.nucleus.ServiceListener, java.util.EventListener, javax.sql.CommonDataSource, javax.sql.XADataSource

public class DerbyDataSource
extends InitializingDataSourceBase

Experimental since Apache Derby is not supported by ATG 9.0. This datasource is used for testing. It starts up a Derby in memory instance on localhost automatically. The database will be named "testdb" by default. If you need to name it something else set the "databaseName" property on this component. You may want to change the name if your test requires running two databases at the same time.

Version:
$Id:$
Author:
adamb

Field Summary
 
Fields inherited from class atg.service.jdbc.InitializingDataSourceBase
mDatabaseName
 
Fields inherited from class atg.service.jdbc.FakeXADataSource
CLASS_VERSION
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
DerbyDataSource()
           
 
Method Summary
 void doStartService()
          Sets Derby JDBC properties to be used when the first client asks for a connection.
 void doStopService()
          Cleans up for dynamo shutdown
static void printSQLException(java.sql.SQLException e)
          Prints details of an SQLException chain to System.err.
 
Methods inherited from class atg.service.jdbc.InitializingDataSourceBase
getDatabaseName, setDatabaseName
 
Methods inherited from class atg.service.jdbc.FakeXADataSource
getAdditionalConnectionProperties, getCloseOrphanedConnections, getDatabase, getDataSource, getDataSourceJNDIEnvironment, getDataSourceJNDIName, getDriver, getLoginDecoder, getLoginTimeout, getLogWriter, getNeedsSeparateUserInfo, getPassword, getReadOnly, getServer, getURL, getUser, getXAConnection, getXAConnection, isCommitOnPrepare, setAdditionalConnectionProperties, setCloseOrphanedConnections, setCommitOnPrepare, setDatabase, setDataSource, setDataSourceJNDIEnvironment, setDataSourceJNDIName, setDriver, setLoginDecoder, setLoginTimeout, setLogWriter, setNeedsSeparateUserInfo, setPassword, setReadOnly, setServer, setURL, setUser
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DerbyDataSource

public DerbyDataSource()
Method Detail

doStartService

public void doStartService()
                    throws atg.nucleus.ServiceException
Sets Derby JDBC properties to be used when the first client asks for a connection.

Overrides:
doStartService in class atg.nucleus.GenericService
Throws:
atg.nucleus.ServiceException

doStopService

public void doStopService()
                   throws atg.nucleus.ServiceException
Cleans up for dynamo shutdown

Overrides:
doStopService in class atg.nucleus.GenericService
Throws:
atg.nucleus.ServiceException

printSQLException

public static void printSQLException(java.sql.SQLException e)
Prints details of an SQLException chain to System.err. Details included are SQL State, Error code, Exception message.

Parameters:
e - the SQLException from which to print details.


Copyright © 2009. All Rights Reserved.