com.atomikos.jdbc
Class DataSourceBean

java.lang.Object
  extended by com.atomikos.jdbc.DataSourceBean
All Implemented Interfaces:
HeuristicDataSource, Serializable, Referenceable, DataSource

public class DataSourceBean
extends Object
implements HeuristicDataSource, Serializable, Referenceable

Copyright © 2003-2004, Atomikos. All rights reserved. A DataSource implementation conform the Java Beans specs. Instances can be setup with a GUI wizard and be serialized for later use. This class is provided for Atomikos tools and should not be used directly; instead, use the class SimpleDataSourceBean in your application.

See Also:
Serialized Form

Constructor Summary
DataSourceBean()
           
 
Method Summary
 void close()
           
 Connection getConnection()
           
 Connection getConnection(HeuristicMessage msg)
          Get a connection to the datasource for the given description of the work.
 Connection getConnection(String msg)
          Get a connection to the datasource for the given description of the work.
 Connection getConnection(String user, String pw)
           
 Connection getConnection(String user, String pw, HeuristicMessage msg)
          Get a connection to the datasource for the given description of the work.
 Connection getConnection(String user, String passwd, String msg)
          Get a connection to the datasource for the given description of the work.
 String getConnectionPoolSize()
           
 String getConnectionTimeout()
           
 String getDataSourceName()
           
 int getLoginTimeout()
           
 PrintWriter getLogWriter()
           
 Reference getReference()
           
 String getTestOnBorrow()
           
 TransactionalResource getTransactionalResource()
           
 String getUniqueResourceName()
           
 String getValidatingQuery()
           
 XADataSource getXaDataSource()
           
 String getXidFormat()
           
 String isExclusiveConnectionMode()
           
 void setConnectionPoolSize(String poolSize)
           
 void setConnectionTimeout(String timeout)
           
 void setDataSourceName(String name)
           
 void setExclusiveConnectionMode(String mode)
           
 void setLoginTimeout(int seconds)
           
 void setLogWriter(PrintWriter out)
           
 void setTestOnBorrow(String value)
           
 void setUniqueResourceName(String resourceName)
           
 void setValidatingQuery(String query)
           
 void setXaDataSource(XADataSource xads)
           
 void setXidFormat(String factory)
           
 void validate()
          Perform validation based on the validating query.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSourceBean

public DataSourceBean()
Method Detail

setTestOnBorrow

public void setTestOnBorrow(String value)

getTestOnBorrow

public String getTestOnBorrow()

setDataSourceName

public void setDataSourceName(String name)

getDataSourceName

public String getDataSourceName()

setXaDataSource

public void setXaDataSource(XADataSource xads)

getXaDataSource

public XADataSource getXaDataSource()

setUniqueResourceName

public void setUniqueResourceName(String resourceName)

getUniqueResourceName

public String getUniqueResourceName()

setXidFormat

public void setXidFormat(String factory)

getXidFormat

public String getXidFormat()

setConnectionPoolSize

public void setConnectionPoolSize(String poolSize)

getConnectionPoolSize

public String getConnectionPoolSize()

setConnectionTimeout

public void setConnectionTimeout(String timeout)

getConnectionTimeout

public String getConnectionTimeout()

setExclusiveConnectionMode

public void setExclusiveConnectionMode(String mode)

isExclusiveConnectionMode

public String isExclusiveConnectionMode()

getTransactionalResource

public TransactionalResource getTransactionalResource()

setValidatingQuery

public void setValidatingQuery(String query)

getValidatingQuery

public String getValidatingQuery()

validate

public void validate()
              throws SQLException
Perform validation based on the validating query. This method does nothing if no query was specified.

Throws:
SQLException - If validation fails.

getConnection

public Connection getConnection()
                         throws SQLException
Specified by:
getConnection in interface DataSource
Throws:
SQLException

getConnection

public Connection getConnection(String user,
                                String pw)
                         throws SQLException
Specified by:
getConnection in interface DataSource
Throws:
SQLException

getConnection

public Connection getConnection(HeuristicMessage msg)
                         throws SQLException
Description copied from interface: HeuristicDataSource
Get a connection to the datasource for the given description of the work.

Specified by:
getConnection in interface HeuristicDataSource
Parameters:
msg - The heuristic message that best describes the work about to be done.
Returns:
Connection The connection.
Throws:
SQLException - On error.

getConnection

public Connection getConnection(String msg)
                         throws SQLException
Description copied from interface: HeuristicDataSource
Get a connection to the datasource for the given description of the work.

Specified by:
getConnection in interface HeuristicDataSource
Parameters:
msg - The heuristic message that best describes the work about to be done.
Returns:
Connection The connection.
Throws:
SQLException - On error.

getConnection

public Connection getConnection(String user,
                                String passwd,
                                String msg)
                         throws SQLException
Description copied from interface: HeuristicDataSource
Get a connection to the datasource for the given description of the work.

Specified by:
getConnection in interface HeuristicDataSource
Parameters:
user - The user name to use.
passwd - The password.
msg - The heuristic message that best describes the work about to be done.
Returns:
Connection The connection.
Throws:
SQLException - On error.

getConnection

public Connection getConnection(String user,
                                String pw,
                                HeuristicMessage msg)
                         throws SQLException
Description copied from interface: HeuristicDataSource
Get a connection to the datasource for the given description of the work.

Specified by:
getConnection in interface HeuristicDataSource
Parameters:
user - The user name to use.
pw - The password.
msg - The heuristic message that best describes the work about to be done.
Returns:
Connection The connection.
Throws:
SQLException - On error.

getLoginTimeout

public int getLoginTimeout()
                    throws SQLException
Specified by:
getLoginTimeout in interface DataSource
Throws:
SQLException

getLogWriter

public PrintWriter getLogWriter()
                         throws SQLException
Specified by:
getLogWriter in interface DataSource
Throws:
SQLException

setLoginTimeout

public void setLoginTimeout(int seconds)
                     throws SQLException
Specified by:
setLoginTimeout in interface DataSource
Throws:
SQLException

setLogWriter

public void setLogWriter(PrintWriter out)
                  throws SQLException
Specified by:
setLogWriter in interface DataSource
Throws:
SQLException

close

public void close()
           throws SQLException
Throws:
SQLException

getReference

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