com.scooterframework.orm.sqldataexpress.connection
Class DatabaseConnectionContextImpl

java.lang.Object
  extended by com.scooterframework.orm.sqldataexpress.connection.DatabaseConnectionContextImpl
All Implemented Interfaces:
DatabaseConnectionContext, java.io.Serializable
Direct Known Subclasses:
DataSourceConnectionContext, JdbcConnectionContext

public abstract class DatabaseConnectionContextImpl
extends java.lang.Object
implements DatabaseConnectionContext

DataSourceConnectionContext class

See Also:
Serialized Form

Field Summary
protected  java.lang.String afterConnectionClassName
           
protected  java.lang.String afterConnectionMethodName
           
protected  boolean autoCommit
           
protected  java.lang.String beforeConnectionClassName
           
protected  java.lang.String beforeConnectionMethodName
           
protected  java.lang.String connectionName
           
protected  java.lang.Integer loginTimeout
           
protected  java.lang.String password
           
protected  java.util.Properties properties
           
protected  boolean readonly
           
protected  java.util.Properties roles
           
protected  java.lang.String schema
           
protected  int transactionIsolationLevel
           
protected  boolean useLoginAsSchema
           
protected  boolean useLoginForConnection
           
protected  java.lang.String username
           
protected  java.lang.String vendor
           
 
Fields inherited from interface com.scooterframework.orm.sqldataexpress.connection.DatabaseConnectionContext
KEY_ACQUIRE_INCREMENT, KEY_AFTER_CONNECTION, KEY_AUTOCOMMIT, KEY_BEFORE_CONNECTION, KEY_CONNECTION_NAME, KEY_DATASOURCENAME, KEY_DRIVER, KEY_INITIAL_POOL_SIZE, KEY_LOGINTIMEOUT, KEY_MAX_IDLE_TIME, KEY_MAX_POOL_SIZE, KEY_MIN_POOL_SIZE, KEY_PASSWORD, KEY_READONLY, KEY_SCHEMA, KEY_TRANSACTION_ISOLATION_LEVEL, KEY_URL, KEY_USE_LOGIN_AS_SCHEMA, KEY_USE_LOGIN_FOR_CONNECTION, KEY_USERNAME, KEY_VENDOR
 
Constructor Summary
DatabaseConnectionContextImpl()
           
DatabaseConnectionContextImpl(java.util.Properties prop)
           
 
Method Summary
protected  java.lang.String checkVendor(java.lang.String input)
          Help method to detect vendor from input string.
 java.lang.String getAfterConnectionClassName()
          Returns after-connection callback class.
 java.lang.String getAfterConnectionMethodName()
          Returns after-connection callback method.
 java.lang.String getBeforeConnectionClassName()
          Returns before-connection callback class.
 java.lang.String getBeforeConnectionMethodName()
          Returns before-connection callback method.
 java.lang.String getConnectionName()
          Returns database connection name
 java.util.Properties getConnectionRoles()
          Returns connection role name and password properties
 java.lang.Integer getLoginTimeout()
          Returns the maximum time in seconds that this data source can wait while attempting to connect to a database
 java.lang.String getPassword()
          Returns database password
 java.util.Properties getProperties()
          Returns all database connection properties
 java.lang.String getSchema()
          Returns the schema of the database connection
 int getTransactionIsolationLevel()
          Returns the specified transaction isolation level.
 java.lang.String getUsername()
          Returns database username
 java.lang.String getVendor()
          Returns the vendor name of the database
 boolean hasSpecifiedTransactionIsolationLevel()
          Checks if transaction isolation level is specified.
 boolean isAutoCommit()
          Checks if the connection is auto-commit.
 boolean isReadonly()
          Checks if the connection is readonly.
 void setAutoCommit(boolean autoCommit)
          Sets auto-commit connection
 void setConnectionRoles(java.util.Properties roles)
          Sets connection role name and password properties
 void setLoginTimeout(java.lang.Integer loginTimeout)
          Sets the loginTimeout name of the database
 void setProperties(java.util.Properties properties)
          Sets all database connection properties
 void setReadonly(boolean readonly)
          Sets readonly connection
 boolean useLoginAsSchema()
          Checks if using login id as schema.
 boolean useLoginForConnection()
          Checks if using login username and password for making a connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connectionName

protected java.lang.String connectionName

beforeConnectionClassName

protected java.lang.String beforeConnectionClassName

beforeConnectionMethodName

protected java.lang.String beforeConnectionMethodName

afterConnectionClassName

protected java.lang.String afterConnectionClassName

afterConnectionMethodName

protected java.lang.String afterConnectionMethodName

username

protected java.lang.String username

password

protected java.lang.String password

loginTimeout

protected java.lang.Integer loginTimeout

readonly

protected boolean readonly

autoCommit

protected boolean autoCommit

transactionIsolationLevel

protected int transactionIsolationLevel

vendor

protected java.lang.String vendor

schema

protected java.lang.String schema

useLoginAsSchema

protected boolean useLoginAsSchema

useLoginForConnection

protected boolean useLoginForConnection

properties

protected java.util.Properties properties

roles

protected java.util.Properties roles
Constructor Detail

DatabaseConnectionContextImpl

public DatabaseConnectionContextImpl()

DatabaseConnectionContextImpl

public DatabaseConnectionContextImpl(java.util.Properties prop)
Method Detail

getConnectionName

public java.lang.String getConnectionName()
Returns database connection name

Specified by:
getConnectionName in interface DatabaseConnectionContext
Returns:
String

getBeforeConnectionClassName

public java.lang.String getBeforeConnectionClassName()
Returns before-connection callback class.

Specified by:
getBeforeConnectionClassName in interface DatabaseConnectionContext

getBeforeConnectionMethodName

public java.lang.String getBeforeConnectionMethodName()
Returns before-connection callback method.

Specified by:
getBeforeConnectionMethodName in interface DatabaseConnectionContext

getAfterConnectionClassName

public java.lang.String getAfterConnectionClassName()
Returns after-connection callback class.

Specified by:
getAfterConnectionClassName in interface DatabaseConnectionContext

getAfterConnectionMethodName

public java.lang.String getAfterConnectionMethodName()
Returns after-connection callback method.

Specified by:
getAfterConnectionMethodName in interface DatabaseConnectionContext

getUsername

public java.lang.String getUsername()
Returns database username

Specified by:
getUsername in interface DatabaseConnectionContext

getPassword

public java.lang.String getPassword()
Returns database password

Specified by:
getPassword in interface DatabaseConnectionContext

getLoginTimeout

public java.lang.Integer getLoginTimeout()
Returns the maximum time in seconds that this data source can wait while attempting to connect to a database

Specified by:
getLoginTimeout in interface DatabaseConnectionContext
Returns:
Integer

setLoginTimeout

public void setLoginTimeout(java.lang.Integer loginTimeout)
Sets the loginTimeout name of the database


isReadonly

public boolean isReadonly()
Checks if the connection is readonly.

Specified by:
isReadonly in interface DatabaseConnectionContext
Returns:
true if readonly connection

setReadonly

public void setReadonly(boolean readonly)
Sets readonly connection

Specified by:
setReadonly in interface DatabaseConnectionContext
Parameters:
readonly - true if read only connection is desired

isAutoCommit

public boolean isAutoCommit()
Checks if the connection is auto-commit.

Specified by:
isAutoCommit in interface DatabaseConnectionContext
Returns:
true if auto-commit connection

setAutoCommit

public void setAutoCommit(boolean autoCommit)
Sets auto-commit connection

Specified by:
setAutoCommit in interface DatabaseConnectionContext
Parameters:
autoCommit - true if auto-commit connection is desired

getVendor

public java.lang.String getVendor()
Returns the vendor name of the database

Specified by:
getVendor in interface DatabaseConnectionContext
Returns:
String

getSchema

public java.lang.String getSchema()
Returns the schema of the database connection

Specified by:
getSchema in interface DatabaseConnectionContext
Returns:
String

useLoginAsSchema

public boolean useLoginAsSchema()
Checks if using login id as schema.

Specified by:
useLoginAsSchema in interface DatabaseConnectionContext
Returns:
true if using login id as schema.

useLoginForConnection

public boolean useLoginForConnection()
Checks if using login username and password for making a connection.

Specified by:
useLoginForConnection in interface DatabaseConnectionContext
Returns:
true if using login username and password for connection.

hasSpecifiedTransactionIsolationLevel

public boolean hasSpecifiedTransactionIsolationLevel()
Checks if transaction isolation level is specified. If not, the database's default transaction isolation level is used.

Specified by:
hasSpecifiedTransactionIsolationLevel in interface DatabaseConnectionContext
Returns:
true if specified

getTransactionIsolationLevel

public int getTransactionIsolationLevel()
Returns the specified transaction isolation level.

Specified by:
getTransactionIsolationLevel in interface DatabaseConnectionContext
Returns:
String

getProperties

public java.util.Properties getProperties()
Returns all database connection properties

Specified by:
getProperties in interface DatabaseConnectionContext

setProperties

public void setProperties(java.util.Properties properties)
Sets all database connection properties

Specified by:
setProperties in interface DatabaseConnectionContext

getConnectionRoles

public java.util.Properties getConnectionRoles()
Returns connection role name and password properties

Specified by:
getConnectionRoles in interface DatabaseConnectionContext

setConnectionRoles

public void setConnectionRoles(java.util.Properties roles)
Sets connection role name and password properties

Specified by:
setConnectionRoles in interface DatabaseConnectionContext

checkVendor

protected java.lang.String checkVendor(java.lang.String input)

Help method to detect vendor from input string. The input string could be one of the following: