org.apache.derby.impl.tools.ij
Class xaHelper

java.lang.Object
  extended byorg.apache.derby.impl.tools.ij.xaHelper
All Implemented Interfaces:
xaAbstractHelper

class xaHelper
extends java.lang.Object
implements xaAbstractHelper


Field Summary
private  javax.sql.ConnectionPoolDataSource currentCPDataSource
           
private  javax.sql.DataSource currentDataSource
           
private  javax.sql.PooledConnection currentPooledConnection
           
private  javax.sql.XAConnection currentXAConnection
           
private  javax.sql.XADataSource currentXADataSource
           
private  java.lang.String databaseName
           
private  java.lang.String framework_property
           
private static java.lang.Class[] INT_P
           
private static java.lang.Class[] STRING_P
           
 
Constructor Summary
(package private) xaHelper()
           
 
Method Summary
 void CommitStatement(ij parser, Token onePhase, Token twoPhase, int xid)
           
 void CPConnectStatement(ij parser, Token userT, Token passT, java.lang.String n)
           
 void CPDataSourceStatement(ij parser, Token dbname, Token protocol)
           
 void CPDisconnectStatement(ij parser, java.lang.String n)
           
 java.sql.Connection CPGetConnectionStatement(ij parser, java.lang.String n)
           
 java.sql.Connection DataSourceStatement(ij parser, Token dbname, Token protocol, Token userT, Token passT, java.lang.String id)
           
 void EndStatement(ij parser, int flag, int xid)
           
 void ForgetStatement(ij parser, int xid)
           
private  javax.sql.XADataSource getXADataSource()
          Get a DataSource that supports distributed transactions.
private  void handleException(java.lang.Throwable t)
           
private  javax.transaction.xa.Xid makeXid(int xid)
           
 void PrepareStatement(ij parser, int xid)
           
 ijResult RecoverStatement(ij parser, int flag)
           
 void RollbackStatement(ij parser, int xid)
           
private static void setDataSourceProperty(java.lang.Object ds, java.lang.String property, java.lang.String value)
           
 void setFramework(java.lang.String framework)
           
 void StartStatement(ij parser, int flag, int xid)
           
 void XAConnectStatement(ij parser, Token user, Token pass, java.lang.String id)
           
 void XADataSourceStatement(ij parser, Token dbname, Token shutdown, java.lang.String create)
           
 void XADisconnectStatement(ij parser, java.lang.String n)
           
 java.sql.Connection XAGetConnectionStatement(ij parser, java.lang.String n)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentXADataSource

private javax.sql.XADataSource currentXADataSource

currentXAConnection

private javax.sql.XAConnection currentXAConnection

databaseName

private java.lang.String databaseName

currentDataSource

private javax.sql.DataSource currentDataSource

currentCPDataSource

private javax.sql.ConnectionPoolDataSource currentCPDataSource

currentPooledConnection

private javax.sql.PooledConnection currentPooledConnection

framework_property

private java.lang.String framework_property

STRING_P

private static final java.lang.Class[] STRING_P

INT_P

private static final java.lang.Class[] INT_P
Constructor Detail

xaHelper

xaHelper()
Method Detail

setFramework

public void setFramework(java.lang.String framework)
Specified by:
setFramework in interface xaAbstractHelper

makeXid

private javax.transaction.xa.Xid makeXid(int xid)

XADataSourceStatement

public void XADataSourceStatement(ij parser,
                                  Token dbname,
                                  Token shutdown,
                                  java.lang.String create)
                           throws java.sql.SQLException
Specified by:
XADataSourceStatement in interface xaAbstractHelper
Throws:
java.sql.SQLException

XAConnectStatement

public void XAConnectStatement(ij parser,
                               Token user,
                               Token pass,
                               java.lang.String id)
                        throws java.sql.SQLException
Specified by:
XAConnectStatement in interface xaAbstractHelper
Throws:
java.sql.SQLException

XADisconnectStatement

public void XADisconnectStatement(ij parser,
                                  java.lang.String n)
                           throws java.sql.SQLException
Specified by:
XADisconnectStatement in interface xaAbstractHelper
Throws:
java.sql.SQLException

XAGetConnectionStatement

public java.sql.Connection XAGetConnectionStatement(ij parser,
                                                    java.lang.String n)
                                             throws java.sql.SQLException
Specified by:
XAGetConnectionStatement in interface xaAbstractHelper
Throws:
java.sql.SQLException

CommitStatement

public void CommitStatement(ij parser,
                            Token onePhase,
                            Token twoPhase,
                            int xid)
                     throws java.sql.SQLException
Specified by:
CommitStatement in interface xaAbstractHelper
Throws:
java.sql.SQLException

EndStatement

public void EndStatement(ij parser,
                         int flag,
                         int xid)
                  throws java.sql.SQLException
Specified by:
EndStatement in interface xaAbstractHelper
Throws:
java.sql.SQLException

ForgetStatement

public void ForgetStatement(ij parser,
                            int xid)
                     throws java.sql.SQLException
Specified by:
ForgetStatement in interface xaAbstractHelper
Throws:
java.sql.SQLException

PrepareStatement

public void PrepareStatement(ij parser,
                             int xid)
                      throws java.sql.SQLException
Specified by:
PrepareStatement in interface xaAbstractHelper
Throws:
java.sql.SQLException

RecoverStatement

public ijResult RecoverStatement(ij parser,
                                 int flag)
                          throws java.sql.SQLException
Specified by:
RecoverStatement in interface xaAbstractHelper
Throws:
java.sql.SQLException

RollbackStatement

public void RollbackStatement(ij parser,
                              int xid)
                       throws java.sql.SQLException
Specified by:
RollbackStatement in interface xaAbstractHelper
Throws:
java.sql.SQLException

StartStatement

public void StartStatement(ij parser,
                           int flag,
                           int xid)
                    throws java.sql.SQLException
Specified by:
StartStatement in interface xaAbstractHelper
Throws:
java.sql.SQLException

handleException

private void handleException(java.lang.Throwable t)
                      throws java.sql.SQLException
Throws:
java.sql.SQLException

DataSourceStatement

public java.sql.Connection DataSourceStatement(ij parser,
                                               Token dbname,
                                               Token protocol,
                                               Token userT,
                                               Token passT,
                                               java.lang.String id)
                                        throws java.sql.SQLException
Specified by:
DataSourceStatement in interface xaAbstractHelper
Throws:
java.sql.SQLException

CPDataSourceStatement

public void CPDataSourceStatement(ij parser,
                                  Token dbname,
                                  Token protocol)
                           throws java.sql.SQLException
Specified by:
CPDataSourceStatement in interface xaAbstractHelper
Throws:
java.sql.SQLException

CPConnectStatement

public void CPConnectStatement(ij parser,
                               Token userT,
                               Token passT,
                               java.lang.String n)
                        throws java.sql.SQLException
Specified by:
CPConnectStatement in interface xaAbstractHelper
Throws:
java.sql.SQLException

CPGetConnectionStatement

public java.sql.Connection CPGetConnectionStatement(ij parser,
                                                    java.lang.String n)
                                             throws java.sql.SQLException
Specified by:
CPGetConnectionStatement in interface xaAbstractHelper
Throws:
java.sql.SQLException

CPDisconnectStatement

public void CPDisconnectStatement(ij parser,
                                  java.lang.String n)
                           throws java.sql.SQLException
Specified by:
CPDisconnectStatement in interface xaAbstractHelper
Throws:
java.sql.SQLException

getXADataSource

private javax.sql.XADataSource getXADataSource()
                                        throws java.lang.Exception
Get a DataSource that supports distributed transactions.

Returns:
XADataSource object
Throws:
java.lang.Exception - if XaDataSource is not in class path.

setDataSourceProperty

private static void setDataSourceProperty(java.lang.Object ds,
                                          java.lang.String property,
                                          java.lang.String value)
                                   throws java.sql.SQLException
Throws:
java.sql.SQLException


Apache Derby V10.0 Engine Documentation - Copyright © 1997,2004 The Apache Software Foundation or its licensors, as applicable.