|
Apache Derby 10.8 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.derby.jdbc.ClientBaseDataSource
public abstract class ClientBaseDataSource
Base class for client-side DataSource implementations.
Field Summary | |
---|---|
static short |
CLEAR_TEXT_PASSWORD_SECURITY
|
protected java.lang.String |
connectionAttributes
|
static short |
ENCRYPTED_PASSWORD_SECURITY
|
static short |
ENCRYPTED_USER_AND_PASSWORD_SECURITY
|
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
|
protected short |
securityMechanism
|
static int |
SSL_BASIC
The constant indicating that SSL encryption will be used. |
static int |
SSL_OFF
The constant indicating that SSL encryption won't be used. |
static int |
SSL_PEER_AUTHENTICATION
The constant indicating that SSL encryption with peer authentication will be used. |
static short |
STRONG_PASSWORD_SUBSTITUTE_SECURITY
|
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 int |
traceLevel
|
static short |
USER_ONLY_SECURITY
The source security mechanism to use when connecting to this data source. |
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 int |
getClientSSLMode(java.util.Properties properties)
Returns the SSL mode specified by the property object. |
java.lang.String |
getConnectionAttributes()
|
java.lang.String |
getCreateDatabase()
|
java.lang.String |
getDatabaseName()
|
java.lang.String |
getDataSourceName()
|
java.lang.String |
getDescription()
|
int |
getLoginTimeout()
|
java.io.PrintWriter |
getLogWriter()
|
java.lang.String |
getPassword()
|
static java.lang.String |
getPassword(java.util.Properties properties)
|
int |
getPortNumber()
|
javax.naming.Reference |
getReference()
|
boolean |
getRetrieveMessageText()
|
static boolean |
getRetrieveMessageText(java.util.Properties properties)
|
short |
getSecurityMechanism()
Return the security mechanism. |
static short |
getSecurityMechanism(java.util.Properties properties)
Return security mechanism if it is set, else upgrade the security mechanism if possible and return the upgraded security mechanism |
short |
getSecurityMechanism(java.lang.String password)
Return the security mechanism for this datasource object. |
java.lang.String |
getServerName()
|
java.lang.String |
getShutdownDatabase()
|
java.lang.String |
getSsl()
Returns the SSL encryption mode specified for the data source. |
static int |
getSSLModeFromString(java.lang.String s)
Parses the string and returns the corresponding constant for the SSL mode denoted. |
java.lang.String |
getTraceDirectory()
|
static java.lang.String |
getTraceDirectory(java.util.Properties properties)
Check if derby.client.traceDirectory is provided as a JVM property. |
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)
Check if derby.client.traceLevel is provided as a JVM property. |
static short |
getUpgradedSecurityMechanism(java.lang.String password)
This method has logic to upgrade security mechanism to a better (more secure) one if it is possible. |
java.lang.String |
getUser()
|
static java.lang.String |
getUser(java.util.Properties properties)
|
protected void |
handleConnectionException(org.apache.derby.client.am.LogWriter logWriter,
org.apache.derby.client.am.SqlException sqle)
Handles common error situations that can happen when trying to obtain a physical connection to the server, and which require special handling. |
int |
maxStatementsToPool()
Returns the maximum number of JDBC prepared statements a connection is allowed to cache. |
void |
setConnectionAttributes(java.lang.String prop)
Set this property to pass in more Derby specific connection URL attributes. |
void |
setCreateDatabase(java.lang.String create)
Set this property to create a new database. |
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)
Sets the security mechanism. |
void |
setServerName(java.lang.String serverName)
|
void |
setShutdownDatabase(java.lang.String shutdown)
Set this property if one wishes to shutdown the database identified by databaseName. |
void |
setSsl(java.lang.String mode)
Specifices the SSL encryption mode to use. |
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)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int propertyDefault_portNumber
public static final java.lang.String propertyDefault_serverName
public static final int SSL_OFF
public static final int SSL_BASIC
public static final int SSL_PEER_AUTHENTICATION
public static final java.lang.String propertyDefault_user
protected short securityMechanism
public static final short propertyDefault_securityMechanism
public static final boolean propertyDefault_retrieveMessageText
public static final boolean propertyDefault_traceFileAppend
public static final short USER_ONLY_SECURITY
public static final short CLEAR_TEXT_PASSWORD_SECURITY
public static final short ENCRYPTED_PASSWORD_SECURITY
public static final short ENCRYPTED_USER_AND_PASSWORD_SECURITY
public static final short STRONG_PASSWORD_SUBSTITUTE_SECURITY
protected java.lang.String connectionAttributes
public static final int TRACE_NONE
public static final int TRACE_CONNECTION_CALLS
public static final int TRACE_STATEMENT_CALLS
public static final int TRACE_RESULT_SET_CALLS
public static final int TRACE_DRIVER_CONFIGURATION
public static final int TRACE_CONNECTS
public static final int TRACE_PROTOCOL_FLOWS
public static final int TRACE_RESULT_SET_META_DATA
public static final int TRACE_PARAMETER_META_DATA
public static final int TRACE_DIAGNOSTICS
public static final int TRACE_XA_CALLS
public static final int TRACE_ALL
public static final int propertyDefault_traceLevel
protected int traceLevel
Method Detail |
---|
public void setLoginTimeout(int seconds)
public int getLoginTimeout()
public void setLogWriter(java.io.PrintWriter logWriter)
public java.io.PrintWriter getLogWriter()
public static final int getSSLModeFromString(java.lang.String s) throws org.apache.derby.client.am.SqlException
Valid values are off, basic and peerAuthentication.
s
- string denoting the SSL mode
null
, SSL_OFF
is returned.
org.apache.derby.client.am.SqlException
- if the string has an invalid valuepublic static final int getClientSSLMode(java.util.Properties properties) throws org.apache.derby.client.am.SqlException
properties
- data source properties
SSL_OFF
if the SSL attribute isn't specified.
org.apache.derby.client.am.SqlException
- if an invalid value for the SSL mode is specified
in the property objectpublic static java.lang.String getUser(java.util.Properties properties)
public static short getSecurityMechanism(java.util.Properties properties)
properties
- Look in the properties if securityMechanism is set or not
if set, return this security mechanism
public static short getUpgradedSecurityMechanism(java.lang.String password)
password
- password argument
public static boolean getRetrieveMessageText(java.util.Properties properties)
public static java.lang.String getTraceFile(java.util.Properties properties)
public static java.lang.String getTraceDirectory(java.util.Properties properties)
properties
- jdbc url properties
public static boolean getTraceFileAppend(java.util.Properties properties)
public static java.lang.String getPassword(java.util.Properties properties)
public final void setPassword(java.lang.String password)
public final java.lang.String getPassword()
public javax.naming.Reference getReference() throws javax.naming.NamingException
getReference
in interface javax.naming.Referenceable
javax.naming.NamingException
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
org.apache.derby.client.am.SqlException
public void setDatabaseName(java.lang.String databaseName)
public java.lang.String getDatabaseName()
public void setDataSourceName(java.lang.String dataSourceName)
public java.lang.String getDataSourceName()
public void setDescription(java.lang.String description)
public java.lang.String getDescription()
public void setPortNumber(int portNumber)
public int getPortNumber()
public void setServerName(java.lang.String serverName)
public java.lang.String getServerName()
public void setUser(java.lang.String user)
public java.lang.String getUser()
public void setRetrieveMessageText(boolean retrieveMessageText)
public boolean getRetrieveMessageText()
public void setSecurityMechanism(short securityMechanism)
securityMechanism
- to setpublic short getSecurityMechanism()
getUpgradedSecurityMechanism(String)
public short getSecurityMechanism(java.lang.String password)
password
- password of user
getUpgradedSecurityMechanism(String)
public void setSsl(java.lang.String mode) throws org.apache.derby.client.am.SqlException
Valid values are off, basic and peerAuthentication.
mode
- the SSL mode to use (off, basic or
peerAuthentication)
org.apache.derby.client.am.SqlException
- if the specified mode is invalidpublic java.lang.String getSsl()
public final void setCreateDatabase(java.lang.String create)
create
- if set to the string "create", this data source will try
to create a new database of databaseName, or boot the
database if one by that name already exists.public final java.lang.String getCreateDatabase()
public final void setShutdownDatabase(java.lang.String shutdown)
shutdown
- if set to the string "shutdown", this data source will
shutdown the database if it is running.public final java.lang.String getShutdownDatabase()
public final void setConnectionAttributes(java.lang.String prop)
prop
- set to the list of Derby 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.
public final java.lang.String getConnectionAttributes()
public static int getTraceLevel(java.util.Properties properties)
properties
- jdbc url properties
public void setTraceLevel(int traceLevel)
public int getTraceLevel()
public void setTraceFile(java.lang.String traceFile)
public java.lang.String getTraceFile()
public void setTraceDirectory(java.lang.String traceDirectory)
public java.lang.String getTraceDirectory()
public void setTraceFileAppend(boolean traceFileAppend)
public boolean getTraceFileAppend()
public int maxStatementsToPool()
A basic data source will always return zero. If statement caching is
required, use a ConnectionPoolDataSource
.
This method is used internally by Derby to determine if statement pooling is to be enabled or not.
0
if
caching is disabled (default).protected final void handleConnectionException(org.apache.derby.client.am.LogWriter logWriter, org.apache.derby.client.am.SqlException sqle) throws java.sql.SQLException
If this method returns normally, the exception wasn't handled and should be handled elsewhere or be re-thrown.
logWriter
- log writer, may be null
sqle
- exception to handle
java.sql.SQLException
- handled exception (if any)
|
Built on Fri 2012-11-02 12:25:54-0700, from revision 1405108 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |