org.apache.torque.pool
Class TorqueClassicDataSource

java.lang.Object
  extended byorg.apache.torque.pool.TorqueClassicDataSource
All Implemented Interfaces:
javax.sql.DataSource, javax.naming.spi.ObjectFactory, javax.naming.Referenceable, java.io.Serializable

Deprecated. as of version 3.1

public class TorqueClassicDataSource
extends java.lang.Object
implements javax.sql.DataSource, javax.naming.Referenceable, java.io.Serializable, javax.naming.spi.ObjectFactory

Torque's default connection pool DataSource

Version:
$Id: TorqueClassicDataSource.java,v 1.11.2.2 2004/05/20 04:36:05 seade Exp $
Author:
John D. McNally, Henning P. Schmiedehausen
See Also:
Serialized Form

Constructor Summary
TorqueClassicDataSource()
          Deprecated. Default no-arg constructor for Serialization
 
Method Summary
 java.sql.Connection getConnection()
          Deprecated. Attempt to establish a database connection.
 java.sql.Connection getConnection(java.lang.String username, java.lang.String password)
          Deprecated. Attempt to establish a database connection.
 javax.sql.ConnectionPoolDataSource getConnectionPoolDataSource()
          Deprecated. Get the value of connectionPoolDataSource.
 int getConnectionWaitTimeout()
          Deprecated. Get the amount of time (in seconds) a connection request will have to wait before a time out occurs and an error is thrown.
 java.lang.String getDataSourceName()
          Deprecated. Get the name of the ConnectionPoolDataSource which backs this pool.
 int getDefaultMaxConnections()
          Deprecated. Get the number of database connections to cache per user.
 java.lang.String getDescription()
          Deprecated. Get the description.
 java.lang.String getJndiEnvironment(java.lang.String key)
          Deprecated. Get the value of jndiEnvironment which is used when instantiating a jndi InitialContext.
 int getLogInterval()
          Deprecated. Get the interval (in seconds) between which the ConnectionPool logs the status of it's Connections.
 int getLoginTimeout()
          Deprecated. Gets the maximum time in seconds that this data source can wait while attempting to connect to a database.
 java.io.PrintWriter getLogWriter()
          Deprecated. Use correct debugging and logging code from Log4j
 int getMaxExpiryTime()
          Deprecated. Get the amount of time (in seconds) that database connections will be cached.
 java.lang.Object getObjectInstance(java.lang.Object refObj, javax.naming.Name name, javax.naming.Context context, java.util.Hashtable env)
          Deprecated. implements ObjectFactory to create an instance of this class
 java.util.Properties getPerUserMaxConnections()
          Deprecated. Get the number of database connections to cache per user.
 javax.naming.Reference getReference()
          Deprecated. Referenceable implementation.
 boolean isDefaultAutoCommit()
          Deprecated. Get the value of defaultAutoCommit, which defines the state of connections handed out from this pool.
 boolean isDefaultReadOnly()
          Deprecated. Get the value of defaultReadOnly, which defines the state of connections handed out from this pool.
 void setConnectionPoolDataSource(javax.sql.ConnectionPoolDataSource v)
          Deprecated. Set the backend ConnectionPoolDataSource.
 void setConnectionWaitTimeout(int v)
          Deprecated. Eet the amount of time (in seconds) a connection request will have to wait before a time out occurs and an error is thrown.
 void setDataSourceName(java.lang.String v)
          Deprecated. Set the name of the ConnectionPoolDataSource which backs this pool.
 void setDefaultAutoCommit(boolean v)
          Deprecated. Set the value of defaultAutoCommit, which defines the state of connections handed out from this pool.
 void setDefaultMaxConnections(int v)
          Deprecated. Set the number of database connections to cache per user.
 void setDefaultReadOnly(boolean v)
          Deprecated. Set the value of defaultReadOnly, which defines the state of connections handed out from this pool.
 void setDescription(java.lang.String v)
          Deprecated. Set the description.
 void setJndiEnvironment(java.lang.String key, java.lang.String value)
          Deprecated. Set the value of jndiEnvironment which is used when instantiating a jndi InitialContext.
 void setLogInterval(int v)
          Deprecated. Set the interval (in seconds) between which the ConnectionPool logs the status of it's Connections.
 void setLoginTimeout(int seconds)
          Deprecated. Sets the maximum time in seconds that this data source will wait while attempting to connect to a database.
 void setLogWriter(java.io.PrintWriter out)
          Deprecated. Use correct debugging and logging code from Log4j
 void setMaxExpiryTime(int v)
          Deprecated. Set the amount of time (in seconds) that database connections will be cached.
 void setPerUserMaxConnections(java.util.Properties v)
          Deprecated. Set the number of database connections to cache per user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TorqueClassicDataSource

public TorqueClassicDataSource()
Deprecated. 
Default no-arg constructor for Serialization

Method Detail

getDefaultMaxConnections

public int getDefaultMaxConnections()
Deprecated. 
Get the number of database connections to cache per user. This value is used for any username which is not specified in perUserMaxConnections. The default is 1.

Returns:
value of maxConnections.

setDefaultMaxConnections

public void setDefaultMaxConnections(int v)
Deprecated. 
Set the number of database connections to cache per user. This value is used for any username which is not specified in perUserMaxConnections. The default is 1.

Parameters:
v - Value to assign to maxConnections.

getPerUserMaxConnections

public java.util.Properties getPerUserMaxConnections()
Deprecated. 
Get the number of database connections to cache per user. The keys are usernames and the value is the maximum connections. Any username specified here will override the value of defaultMaxConnections.

Returns:
value of perUserMaxConnections.

setPerUserMaxConnections

public void setPerUserMaxConnections(java.util.Properties v)
Deprecated. 
Set the number of database connections to cache per user. The keys are usernames and the value is the maximum connections. Any username specified here will override the value of defaultMaxConnections.

Parameters:
v - Value to assign to perUserMaxConnections.

getMaxExpiryTime

public int getMaxExpiryTime()
Deprecated. 
Get the amount of time (in seconds) that database connections will be cached. The default is 3600 (1 hour).

Returns:
value of expiryTime.

setMaxExpiryTime

public void setMaxExpiryTime(int v)
Deprecated. 
Set the amount of time (in seconds) that database connections will be cached. The default is 3600 (1 hour).

Parameters:
v - Value to assign to expiryTime.

getConnectionWaitTimeout

public int getConnectionWaitTimeout()
Deprecated. 
Get the amount of time (in seconds) a connection request will have to wait before a time out occurs and an error is thrown. The default is 10 seconds.

Returns:
value of connectionWaitTimeout.

setConnectionWaitTimeout

public void setConnectionWaitTimeout(int v)
Deprecated. 
Eet the amount of time (in seconds) a connection request will have to wait before a time out occurs and an error is thrown. The default is 10 seconds.

Parameters:
v - Value to assign to connectionWaitTimeout.

getLogInterval

public int getLogInterval()
Deprecated. 
Get the interval (in seconds) between which the ConnectionPool logs the status of it's Connections. Default is 0 which indicates no logging.

Returns:
value of logInterval.

setLogInterval

public void setLogInterval(int v)
Deprecated. 
Set the interval (in seconds) between which the ConnectionPool logs the status of it's Connections. Default is 0 which indicates no logging.

Parameters:
v - Value to assign to logInterval.

isDefaultAutoCommit

public boolean isDefaultAutoCommit()
Deprecated. 
Get the value of defaultAutoCommit, which defines the state of connections handed out from this pool. The value can be changed on the Connection using Connection.setAutoCommit(boolean). The default is true.

Returns:
value of defaultAutoCommit.

setDefaultAutoCommit

public void setDefaultAutoCommit(boolean v)
Deprecated. 
Set the value of defaultAutoCommit, which defines the state of connections handed out from this pool. The value can be changed on the Connection using Connection.setAutoCommit(boolean). The default is true.

Parameters:
v - Value to assign to defaultAutoCommit.

isDefaultReadOnly

public boolean isDefaultReadOnly()
Deprecated. 
Get the value of defaultReadOnly, which defines the state of connections handed out from this pool. The value can be changed on the Connection using Connection.setReadOnly(boolean). The default is false.

Returns:
value of defaultReadOnly.

setDefaultReadOnly

public void setDefaultReadOnly(boolean v)
Deprecated. 
Set the value of defaultReadOnly, which defines the state of connections handed out from this pool. The value can be changed on the Connection using Connection.setReadOnly(boolean). The default is false.

Parameters:
v - Value to assign to defaultReadOnly.

getDataSourceName

public java.lang.String getDataSourceName()
Deprecated. 
Get the name of the ConnectionPoolDataSource which backs this pool. This name is used to look up the datasource from a jndi service provider.

Returns:
value of dataSourceName.

setDataSourceName

public void setDataSourceName(java.lang.String v)
Deprecated. 
Set the name of the ConnectionPoolDataSource which backs this pool. This name is used to look up the datasource from a jndi service provider.

Parameters:
v - Value to assign to dataSourceName.

getDescription

public java.lang.String getDescription()
Deprecated. 
Get the description. This property is defined by jdbc as for use with GUI (or other) tools that might deploy the datasource. It serves no internal purpose.

Returns:
value of description.

setDescription

public void setDescription(java.lang.String v)
Deprecated. 
Set the description. This property is defined by jdbc as for use with GUI (or other) tools that might deploy the datasource. It serves no internal purpose.

Parameters:
v - Value to assign to description.

getJndiEnvironment

public java.lang.String getJndiEnvironment(java.lang.String key)
Deprecated. 
Get the value of jndiEnvironment which is used when instantiating a jndi InitialContext. This InitialContext is used to locate the backend ConnectionPoolDataSource.

Parameters:
key - environment key
Returns:
value of jndiEnvironment.

setJndiEnvironment

public void setJndiEnvironment(java.lang.String key,
                               java.lang.String value)
Deprecated. 
Set the value of jndiEnvironment which is used when instantiating a jndi InitialContext. This InitialContext is used to locate the backend ConnectionPoolDataSource.

Parameters:
key - environment key
value - Value to assign to jndiEnvironment.

getConnectionPoolDataSource

public javax.sql.ConnectionPoolDataSource getConnectionPoolDataSource()
Deprecated. 
Get the value of connectionPoolDataSource. This method will return null, if the backing datasource is being accessed via jndi.

Returns:
value of connectionPoolDataSource.

setConnectionPoolDataSource

public void setConnectionPoolDataSource(javax.sql.ConnectionPoolDataSource v)
Deprecated. 
Set the backend ConnectionPoolDataSource. This property should not be set if using jndi to access the datasource.

Parameters:
v - Value to assign to connectionPoolDataSource.

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Deprecated. 
Attempt to establish a database connection.

Specified by:
getConnection in interface javax.sql.DataSource
Returns:
A database connection.
Throws:
java.sql.SQLException

getConnection

public java.sql.Connection getConnection(java.lang.String username,
                                         java.lang.String password)
                                  throws java.sql.SQLException
Deprecated. 
Attempt to establish a database connection.

Specified by:
getConnection in interface javax.sql.DataSource
Parameters:
username - The name of the database user.
password - The password of the database user.
Returns:
A database connection.
Throws:
java.sql.SQLException

getLoginTimeout

public int getLoginTimeout()
Deprecated. 
Gets the maximum time in seconds that this data source can wait while attempting to connect to a database.

Specified by:
getLoginTimeout in interface javax.sql.DataSource
Returns:
the login timeout

getLogWriter

public java.io.PrintWriter getLogWriter()
Deprecated. Use correct debugging and logging code from Log4j

Get the log writer for this data source.

Specified by:
getLogWriter in interface javax.sql.DataSource
Returns:
the log writer

setLoginTimeout

public void setLoginTimeout(int seconds)
Deprecated. 
Sets the maximum time in seconds that this data source will wait while attempting to connect to a database. NOT USED.

Specified by:
setLoginTimeout in interface javax.sql.DataSource
Parameters:
seconds - the login timeout

setLogWriter

public void setLogWriter(java.io.PrintWriter out)
Deprecated. Use correct debugging and logging code from Log4j

Set the log writer for this data source.

Specified by:
setLogWriter in interface javax.sql.DataSource
Parameters:
out - the log writer to use

getReference

public javax.naming.Reference getReference()
                                    throws javax.naming.NamingException
Deprecated. 
Referenceable implementation.

Specified by:
getReference in interface javax.naming.Referenceable
Returns:
a reference
Throws:
javax.naming.NamingException

getObjectInstance

public java.lang.Object getObjectInstance(java.lang.Object refObj,
                                          javax.naming.Name name,
                                          javax.naming.Context context,
                                          java.util.Hashtable env)
                                   throws java.lang.Exception
Deprecated. 
implements ObjectFactory to create an instance of this class

Specified by:
getObjectInstance in interface javax.naming.spi.ObjectFactory
Parameters:
refObj -
name -
context -
env -
Returns:
an instance of this class
Throws:
java.lang.Exception


Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.