org.openorb.ots.xa
Class XAVirtualDataSource

java.lang.Object
  extended by org.openorb.ots.xa.XAVirtualDataSource
All Implemented Interfaces:
javax.sql.CommonDataSource, javax.sql.XADataSource

public class XAVirtualDataSource
extends java.lang.Object
implements javax.sql.XADataSource

This class provides a virtual XA data source to manage an XA session without a jdbc driver that includes optional packages of JDBC 2.0

Author:
Jerome Daniel

Constructor Summary
XAVirtualDataSource(org.omg.CORBA.ORB orb, org.apache.avalon.framework.logger.Logger logger)
          Constructor
 
Method Summary
 org.apache.avalon.framework.logger.Logger getLogger()
           
 int getLoginTimeout()
          Return the login timeout in seconds.
 java.io.PrintWriter getLogWriter()
          Return the log writer.
 java.lang.String getMetaData()
          Return the DataSource meta data
 javax.sql.XAConnection getXAConnection()
          This operation is called to get an XA connection from a database.
 javax.sql.XAConnection getXAConnection(java.lang.String user, java.lang.String password)
          This operation is called to get an XA connection from a database by providing user name and user password.
 void set_jdbc_url(java.lang.String url)
          This operation is used to set the JDBC URL required for the database access.
 void setLoginTimeout(int seconds)
          Set the login timeout in seconds.
 void setLogWriter(java.io.PrintWriter out)
          Set the log writer
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XAVirtualDataSource

public XAVirtualDataSource(org.omg.CORBA.ORB orb,
                           org.apache.avalon.framework.logger.Logger logger)
Constructor

Method Detail

getLoginTimeout

public int getLoginTimeout()
                    throws java.sql.SQLException
Return the login timeout in seconds.

Specified by:
getLoginTimeout in interface javax.sql.CommonDataSource
Throws:
java.sql.SQLException

getLogWriter

public java.io.PrintWriter getLogWriter()
                                 throws java.sql.SQLException
Return the log writer.

Specified by:
getLogWriter in interface javax.sql.CommonDataSource
Throws:
java.sql.SQLException

getXAConnection

public javax.sql.XAConnection getXAConnection()
                                       throws java.sql.SQLException
This operation is called to get an XA connection from a database. The user name and user password are taken from the OpenORB OTS properties file.

Specified by:
getXAConnection in interface javax.sql.XADataSource
Throws:
java.sql.SQLException

getXAConnection

public javax.sql.XAConnection getXAConnection(java.lang.String user,
                                              java.lang.String password)
                                       throws java.sql.SQLException
This operation is called to get an XA connection from a database by providing user name and user password.

Specified by:
getXAConnection in interface javax.sql.XADataSource
Throws:
java.sql.SQLException

setLoginTimeout

public void setLoginTimeout(int seconds)
                     throws java.sql.SQLException
Set the login timeout in seconds.

Specified by:
setLoginTimeout in interface javax.sql.CommonDataSource
Throws:
java.sql.SQLException

setLogWriter

public void setLogWriter(java.io.PrintWriter out)
                  throws java.sql.SQLException
Set the log writer

Specified by:
setLogWriter in interface javax.sql.CommonDataSource
Throws:
java.sql.SQLException

set_jdbc_url

public void set_jdbc_url(java.lang.String url)
This operation is used to set the JDBC URL required for the database access.


getMetaData

public java.lang.String getMetaData()
Return the DataSource meta data


getLogger

public org.apache.avalon.framework.logger.Logger getLogger()