org.apache.derby.jdbc
Class ClientBaseDataSource

java.lang.Object
  extended byorg.apache.derby.jdbc.ClientBaseDataSource
All Implemented Interfaces:
javax.naming.Referenceable, java.io.Serializable
Direct Known Subclasses:
ClientDataSource

public abstract class ClientBaseDataSource
extends java.lang.Object
implements java.io.Serializable, javax.naming.Referenceable

Base class for client-side DataSource implementations.

See Also:
Serialized Form

Field Summary
static short CLEAR_TEXT_PASSWORD_SECURITY
           
static int CLOSE_CURSORS_AT_COMMIT
           
protected  java.lang.String connectionAttributes
           
protected  java.lang.String databaseName
           
protected  java.lang.String dataSourceName
           
protected  java.lang.String description
           
static short ENCRYPTED_PASSWORD_SECURITY
           
static short ENCRYPTED_USER_AND_PASSWORD_SECURITY
           
static int HOLD_CURSORS_OVER_COMMIT
           
protected  int loginTimeout
          The time in seconds to wait for a connection request on this data source.
protected  java.io.PrintWriter logWriter
          The log writer is declared transient, and is not serialized or stored under JNDI.
static int NO
           
static int NOT_SET
           
protected  java.lang.String password
           
protected  int portNumber
           
static int propertyDefault_loginTimeout
           
static int propertyDefault_portNumber
           
static boolean propertyDefault_retrieveMessageText
           
static short propertyDefault_securityMechanism
           
static java.lang.String propertyDefault_serverName
           
static boolean propertyDefault_traceFileAppend
           
static int propertyDefault_traceLevel
           
static java.lang.String propertyDefault_user
           
static java.lang.String propertyKey_databaseName
           
static java.lang.String propertyKey_dataSourceName
           
static java.lang.String propertyKey_description
           
static java.lang.String propertyKey_loginTimeout
           
static java.lang.String propertyKey_password
           
static java.lang.String propertyKey_portNumber
           
static java.lang.String propertyKey_retrieveMessageText
           
static java.lang.String propertyKey_securityMechanism
           
static java.lang.String propertyKey_serverName
           
static java.lang.String propertyKey_traceDirectory
           
static java.lang.String propertyKey_traceFile
           
static java.lang.String propertyKey_traceFileAppend
           
static java.lang.String propertyKey_traceLevel
           
static java.lang.String propertyKey_user
           
protected  boolean retrieveMessageText
           
protected  short securityMechanism
           
protected  java.lang.String serverName
           
static int TRACE_ALL
           
static int TRACE_CONNECTION_CALLS
           
static int TRACE_CONNECTS
           
static int TRACE_DIAGNOSTICS
           
static int TRACE_DRIVER_CONFIGURATION
           
static int TRACE_NONE
           
static int TRACE_PARAMETER_META_DATA
           
static int TRACE_PROTOCOL_FLOWS
           
static int TRACE_RESULT_SET_CALLS
           
static int TRACE_RESULT_SET_META_DATA
           
static int TRACE_STATEMENT_CALLS
           
static int TRACE_XA_CALLS
           
protected  java.lang.String traceDirectory
           
protected  java.lang.String traceFile
           
protected  boolean traceFileAppend
           
protected  int traceLevel
           
protected  java.lang.String user
           
static short USER_ONLY_SECURITY
          The source security mechanism to use when connecting to this data source.
static int YES
           
 
Constructor Summary
protected ClientBaseDataSource()
           
 
Method Summary
static org.apache.derby.client.am.LogWriter computeDncLogWriter(org.apache.derby.client.am.Connection connection, java.io.PrintWriter logWriter, java.lang.String traceDirectory, java.lang.String traceFile, boolean traceFileAppend, java.lang.String logWriterInUseSuffix, int traceFileSuffixIndex, int traceLevel)
           
static org.apache.derby.client.am.LogWriter computeDncLogWriterForNewConnection(java.io.PrintWriter logWriter, java.lang.String traceDirectory, java.lang.String traceFile, boolean traceFileAppend, int traceLevel, java.lang.String logWriterInUseSuffix, int traceFileSuffixIndex)
           
 org.apache.derby.client.am.LogWriter computeDncLogWriterForNewConnection(java.lang.String logWriterInUseSuffix)
           
 java.lang.String getConnectionAttributes()
           
 java.lang.String getDatabaseName()
           
 java.lang.String getDataSourceName()
           
 java.lang.String getDescription()
           
 int getLoginTimeout()
           
 java.io.PrintWriter getLogWriter()
           
static java.lang.String getPassword(java.util.Properties properties)
           
 int getPortNumber()
           
 java.util.Properties getProperties()
          Not an external.
 javax.naming.Reference getReference()
           
 boolean getRetrieveMessageText()
           
static boolean getRetrieveMessageText(java.util.Properties properties)
           
 short getSecurityMechanism()
           
static short getSecurityMechanism(java.util.Properties properties)
           
 java.lang.String getServerName()
           
 java.lang.String getTraceDirectory()
           
static java.lang.String getTraceDirectory(java.util.Properties properties)
           
 java.lang.String getTraceFile()
           
static java.lang.String getTraceFile(java.util.Properties properties)
           
 boolean getTraceFileAppend()
           
static boolean getTraceFileAppend(java.util.Properties properties)
           
 int getTraceLevel()
           
static int getTraceLevel(java.util.Properties properties)
           
static short getUpgradedSecurityMechanism(short securityMechanism, java.lang.String password)
          Upgrade the security mechansim to USRIDPWD if it is set to USRIDONL but we have a password.
 java.lang.String getUser()
           
static java.lang.String getUser(java.util.Properties properties)
           
 void hydrateFromReference(javax.naming.Reference ref)
          Not an external.
 void setConnectionAttributes(java.lang.String prop)
          Set this property to pass in more Derby specific connection URL attributes.
 void setDatabaseName(java.lang.String databaseName)
           
 void setDataSourceName(java.lang.String dataSourceName)
           
 void setDescription(java.lang.String description)
           
 void setLoginTimeout(int seconds)
           
 void setLogWriter(java.io.PrintWriter logWriter)
           
 void setPassword(java.lang.String password)
           
 void setPortNumber(int portNumber)
           
 void setRetrieveMessageText(boolean retrieveMessageText)
           
 void setSecurityMechanism(short securityMechanism)
           
 void setServerName(java.lang.String serverName)
           
 void setTraceDirectory(java.lang.String traceDirectory)
           
 void setTraceFile(java.lang.String traceFile)
           
 void setTraceFileAppend(boolean traceFileAppend)
           
 void setTraceLevel(int traceLevel)
           
 void setUser(java.lang.String user)
           
static java.util.Properties tokenizeAttributes(java.lang.String attributeString, java.util.Properties properties)
           
protected  void updateDataSourceValues(java.util.Properties prop)
          The dataSource keeps individual fields for the values that are relevant to the client.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

loginTimeout

protected int loginTimeout
The time in seconds to wait for a connection request on this data source. The default value of zero indicates that either the system time out be used or no timeout limit.


propertyKey_loginTimeout

public static final java.lang.String propertyKey_loginTimeout
See Also:
Constant Field Values

propertyDefault_loginTimeout

public static final int propertyDefault_loginTimeout
See Also:
Constant Field Values

logWriter

protected transient java.io.PrintWriter logWriter
The log writer is declared transient, and is not serialized or stored under JNDI.

See Also:
traceLevel

databaseName

protected java.lang.String databaseName

propertyKey_databaseName

public static final java.lang.String propertyKey_databaseName
See Also:
Constant Field Values

description

protected java.lang.String description

propertyKey_description

public static final java.lang.String propertyKey_description
See Also:
Constant Field Values

dataSourceName

protected java.lang.String dataSourceName

propertyKey_dataSourceName

public static final java.lang.String propertyKey_dataSourceName
See Also:
Constant Field Values

portNumber

protected int portNumber

propertyDefault_portNumber

public static final int propertyDefault_portNumber
See Also:
Constant Field Values

propertyKey_portNumber

public static final java.lang.String propertyKey_portNumber
See Also:
Constant Field Values

serverName

protected java.lang.String serverName

propertyDefault_serverName

public static final java.lang.String propertyDefault_serverName
See Also:
Constant Field Values

propertyKey_serverName

public static final java.lang.String propertyKey_serverName
See Also:
Constant Field Values

user

protected java.lang.String user

propertyKey_user

public static final java.lang.String propertyKey_user
See Also:
Constant Field Values

propertyDefault_user

public static final java.lang.String propertyDefault_user
See Also:
Constant Field Values

HOLD_CURSORS_OVER_COMMIT

public static final int HOLD_CURSORS_OVER_COMMIT
See Also:
Constant Field Values

CLOSE_CURSORS_AT_COMMIT

public static final int CLOSE_CURSORS_AT_COMMIT
See Also:
Constant Field Values

NOT_SET

public static final int NOT_SET
See Also:
Constant Field Values

YES

public static final int YES
See Also:
Constant Field Values

NO

public static final int NO
See Also:
Constant Field Values

securityMechanism

protected short securityMechanism

propertyDefault_securityMechanism

public static final short propertyDefault_securityMechanism
See Also:
Constant Field Values

propertyKey_securityMechanism

public static final java.lang.String propertyKey_securityMechanism
See Also:
Constant Field Values

retrieveMessageText

protected boolean retrieveMessageText

propertyDefault_retrieveMessageText

public static final boolean propertyDefault_retrieveMessageText
See Also:
Constant Field Values

propertyKey_retrieveMessageText

public static final java.lang.String propertyKey_retrieveMessageText
See Also:
Constant Field Values

traceFile

protected java.lang.String traceFile

propertyKey_traceFile

public static final java.lang.String propertyKey_traceFile
See Also:
Constant Field Values

traceDirectory

protected java.lang.String traceDirectory

propertyKey_traceDirectory

public static final java.lang.String propertyKey_traceDirectory
See Also:
Constant Field Values

traceFileAppend

protected boolean traceFileAppend

propertyDefault_traceFileAppend

public static final boolean propertyDefault_traceFileAppend
See Also:
Constant Field Values

propertyKey_traceFileAppend

public static final java.lang.String propertyKey_traceFileAppend
See Also:
Constant Field Values

propertyKey_password

public static final java.lang.String propertyKey_password
See Also:
Constant Field Values

password

protected java.lang.String password

USER_ONLY_SECURITY

public static final short USER_ONLY_SECURITY
The source security mechanism to use when connecting to this data source.

Security mechanism options are:

The default security mechanism is USER_ONLY SECURITY

If the application specifies a security mechanism then it will be the only one attempted. If the specified security mechanism is not supported by the conversation then an exception will be thrown and there will be no additional retries.

This property is currently only available for the DNC driver.

Both user and password need to be set for all security mechanism except USER_ONLY_SECURITY

See Also:
Constant Field Values

CLEAR_TEXT_PASSWORD_SECURITY

public static final short CLEAR_TEXT_PASSWORD_SECURITY
See Also:
Constant Field Values

ENCRYPTED_PASSWORD_SECURITY

public static final short ENCRYPTED_PASSWORD_SECURITY
See Also:
Constant Field Values

ENCRYPTED_USER_AND_PASSWORD_SECURITY

public static final short ENCRYPTED_USER_AND_PASSWORD_SECURITY
See Also:
Constant Field Values

connectionAttributes

protected java.lang.String connectionAttributes

TRACE_NONE

public static final int TRACE_NONE
See Also:
Constant Field Values

TRACE_CONNECTION_CALLS

public static final int TRACE_CONNECTION_CALLS
See Also:
Constant Field Values

TRACE_STATEMENT_CALLS

public static final int TRACE_STATEMENT_CALLS
See Also:
Constant Field Values

TRACE_RESULT_SET_CALLS

public static final int TRACE_RESULT_SET_CALLS
See Also:
Constant Field Values

TRACE_DRIVER_CONFIGURATION

public static final int TRACE_DRIVER_CONFIGURATION
See Also:
Constant Field Values

TRACE_CONNECTS

public static final int TRACE_CONNECTS
See Also:
Constant Field Values

TRACE_PROTOCOL_FLOWS

public static final int TRACE_PROTOCOL_FLOWS
See Also:
Constant Field Values

TRACE_RESULT_SET_META_DATA

public static final int TRACE_RESULT_SET_META_DATA
See Also:
Constant Field Values

TRACE_PARAMETER_META_DATA

public static final int TRACE_PARAMETER_META_DATA
See Also:
Constant Field Values

TRACE_DIAGNOSTICS

public static final int TRACE_DIAGNOSTICS
See Also:
Constant Field Values

TRACE_XA_CALLS

public static final int TRACE_XA_CALLS
See Also:
Constant Field Values

TRACE_ALL

public static final int TRACE_ALL
See Also:
Constant Field Values

propertyDefault_traceLevel

public static final int propertyDefault_traceLevel
See Also:
Constant Field Values

propertyKey_traceLevel

public static final java.lang.String propertyKey_traceLevel
See Also:
Constant Field Values

traceLevel

protected int traceLevel
Constructor Detail

ClientBaseDataSource

protected ClientBaseDataSource()
Method Detail

setLoginTimeout

public void setLoginTimeout(int seconds)

getLoginTimeout

public int getLoginTimeout()

setLogWriter

public void setLogWriter(java.io.PrintWriter logWriter)

getLogWriter

public java.io.PrintWriter getLogWriter()

getUser

public static java.lang.String getUser(java.util.Properties properties)

getSecurityMechanism

public static short getSecurityMechanism(java.util.Properties properties)

getUpgradedSecurityMechanism

public static short getUpgradedSecurityMechanism(short securityMechanism,
                                                 java.lang.String password)
Upgrade the security mechansim to USRIDPWD if it is set to USRIDONL but we have a password.


getRetrieveMessageText

public static boolean getRetrieveMessageText(java.util.Properties properties)

getTraceFile

public static java.lang.String getTraceFile(java.util.Properties properties)

getTraceDirectory

public static java.lang.String getTraceDirectory(java.util.Properties properties)

getTraceFileAppend

public static boolean getTraceFileAppend(java.util.Properties properties)

getPassword

public static java.lang.String getPassword(java.util.Properties properties)

setPassword

public void setPassword(java.lang.String password)

getReference

public javax.naming.Reference getReference()
                                    throws javax.naming.NamingException
Specified by:
getReference in interface javax.naming.Referenceable
Throws:
javax.naming.NamingException

hydrateFromReference

public void hydrateFromReference(javax.naming.Reference ref)
                          throws java.sql.SQLException
Not an external. Do not document in pubs. Populates member data for this data source given a JNDI reference.

Throws:
java.sql.SQLException

getProperties

public java.util.Properties getProperties()
                                   throws java.sql.SQLException
Not an external. Do not document in pubs. Returns all non-transient properties of a ClientBaseDataSource.

Throws:
java.sql.SQLException

computeDncLogWriterForNewConnection

public org.apache.derby.client.am.LogWriter computeDncLogWriterForNewConnection(java.lang.String logWriterInUseSuffix)
                                                                         throws org.apache.derby.client.am.SqlException
Throws:
org.apache.derby.client.am.SqlException

computeDncLogWriterForNewConnection

public static org.apache.derby.client.am.LogWriter computeDncLogWriterForNewConnection(java.io.PrintWriter logWriter,
                                                                                       java.lang.String traceDirectory,
                                                                                       java.lang.String traceFile,
                                                                                       boolean traceFileAppend,
                                                                                       int traceLevel,
                                                                                       java.lang.String logWriterInUseSuffix,
                                                                                       int traceFileSuffixIndex)
                                                                                throws org.apache.derby.client.am.SqlException
Throws:
org.apache.derby.client.am.SqlException

computeDncLogWriter

public static org.apache.derby.client.am.LogWriter computeDncLogWriter(org.apache.derby.client.am.Connection connection,
                                                                       java.io.PrintWriter logWriter,
                                                                       java.lang.String traceDirectory,
                                                                       java.lang.String traceFile,
                                                                       boolean traceFileAppend,
                                                                       java.lang.String logWriterInUseSuffix,
                                                                       int traceFileSuffixIndex,
                                                                       int traceLevel)
                                                                throws org.apache.derby.client.am.SqlException
Throws:
org.apache.derby.client.am.SqlException

tokenizeAttributes

public static java.util.Properties tokenizeAttributes(java.lang.String attributeString,
                                                      java.util.Properties properties)
                                               throws org.apache.derby.client.am.SqlException
Throws:
org.apache.derby.client.am.SqlException

setDatabaseName

public void setDatabaseName(java.lang.String databaseName)

getDatabaseName

public java.lang.String getDatabaseName()

setDataSourceName

public void setDataSourceName(java.lang.String dataSourceName)

getDataSourceName

public java.lang.String getDataSourceName()

setDescription

public void setDescription(java.lang.String description)

getDescription

public java.lang.String getDescription()

setPortNumber

public void setPortNumber(int portNumber)

getPortNumber

public int getPortNumber()

setServerName

public void setServerName(java.lang.String serverName)

getServerName

public java.lang.String getServerName()

setUser

public void setUser(java.lang.String user)

getUser

public java.lang.String getUser()

setRetrieveMessageText

public void setRetrieveMessageText(boolean retrieveMessageText)

getRetrieveMessageText

public boolean getRetrieveMessageText()

setSecurityMechanism

public void setSecurityMechanism(short securityMechanism)

getSecurityMechanism

public short getSecurityMechanism()

setConnectionAttributes

public final void setConnectionAttributes(java.lang.String prop)
Set this property to pass in more Derby specific connection URL attributes.

Parameters:
prop - set to the list of Cloudscape connection attributes separated by semi-colons. E.g., to specify an encryption bootPassword of "x8hhk2adf", and set upgrade to true, do the following:
             ds.setConnectionAttributes("bootPassword=x8hhk2adf;upgrade=true"); 
See Derby documentation for complete list.

getConnectionAttributes

public final java.lang.String getConnectionAttributes()
Returns:
Derby specific connection URL attributes

getTraceLevel

public static int getTraceLevel(java.util.Properties properties)

setTraceLevel

public void setTraceLevel(int traceLevel)

getTraceLevel

public int getTraceLevel()

setTraceFile

public void setTraceFile(java.lang.String traceFile)

getTraceFile

public java.lang.String getTraceFile()

setTraceDirectory

public void setTraceDirectory(java.lang.String traceDirectory)

getTraceDirectory

public java.lang.String getTraceDirectory()

setTraceFileAppend

public void setTraceFileAppend(boolean traceFileAppend)

getTraceFileAppend

public boolean getTraceFileAppend()

updateDataSourceValues

protected void updateDataSourceValues(java.util.Properties prop)
The dataSource keeps individual fields for the values that are relevant to the client. These need to be updated when set connection attributes is called.


Built on Mon 2006-06-26 13:14:15-0700, from revision 417277

Apache Derby 10.1 API Documentation - Copyright © 1997,2005 The Apache Software Foundation or its licensors, as applicable.