Tea Java Runtime API
Version 3.1.0

com.pdmfc.tea.modules.tdbc
Class SConnection

java.lang.Object
  |
  +--com.pdmfc.tea.modules.tos.STosObj
        |
        +--com.pdmfc.tea.modules.tdbc.SConnection
All Implemented Interfaces:
com.pdmfc.tea.modules.tdbc.SClosedEventListener, SObjFunction

public class SConnection
extends STosObj
implements com.pdmfc.tea.modules.tdbc.SClosedEventListener

Implements an TOS object that acts like a java Connection.


Constructor Summary
SConnection(STosClass myClass)
           
 
Method Summary
 void addClosedListener(com.pdmfc.tea.modules.tdbc.SClosedEventListener listener)
           
 java.lang.Object autocommit(SObjFunction obj, SContext context, java.lang.Object[] args)
           
 java.lang.Object close(SObjFunction obj, SContext context, java.lang.Object[] args)
           
 void closedEvent(java.lang.Object closedObject)
          Signals that an object has been closed.
 java.lang.Object commit(SObjFunction obj, SContext context, java.lang.Object[] args)
          Commits the transaction bound to this connection.
 void connect(java.sql.Connection connection)
          Establishes a connection to the database by using an externally supplied java.sql.Connection.
 java.lang.Object connect(SObjFunction obj, SContext context, java.lang.Object[] args)
           
 java.lang.Object constructor(SObjFunction obj, SContext context, java.lang.Object[] args)
           
static java.lang.String getTosClassName()
           
 java.lang.Object prepare(SObjFunction obj, SContext context, java.lang.Object[] args)
           
 java.lang.Object prepareCall(SObjFunction obj, SContext context, java.lang.Object[] args)
           
 java.lang.Object rollback(SObjFunction obj, SContext context, java.lang.Object[] args)
           
 java.lang.Object statement(SObjFunction obj, SContext context, java.lang.Object[] args)
          Creates a new instance of an SStatement.
 
Methods inherited from class com.pdmfc.tea.modules.tos.STosObj
exec, getTosClass, init, part, selfObj
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SConnection

public SConnection(STosClass myClass)
            throws STeaException
Method Detail

getTosClassName

public static java.lang.String getTosClassName()

addClosedListener

public void addClosedListener(com.pdmfc.tea.modules.tdbc.SClosedEventListener listener)

constructor

public java.lang.Object constructor(SObjFunction obj,
                                    SContext context,
                                    java.lang.Object[] args)
                             throws STeaException

connect

public java.lang.Object connect(SObjFunction obj,
                                SContext context,
                                java.lang.Object[] args)
                         throws STeaException

connect

public void connect(java.sql.Connection connection)
             throws java.sql.SQLException
Establishes a connection to the database by using an externally supplied java.sql.Connection. If a connection was previously established then it is closed.

The connection object will have its autocommit flag turned off.

Parameters:
connection - The java.sql.Connection that will be used to communicate with the database.
Throws:
java.sql.Exception - Thrown if there were problems while turning off the autocommit flag for the connection.

statement

public java.lang.Object statement(SObjFunction obj,
                                  SContext context,
                                  java.lang.Object[] args)
                           throws STeaException
Creates a new instance of an SStatement.
Returns:
A newly created SStatement object.
Throws:
STeaException - Thrown if there were any problems obtaining a new statemente or if there is no connection yet.

prepare

public java.lang.Object prepare(SObjFunction obj,
                                SContext context,
                                java.lang.Object[] args)
                         throws STeaException

prepareCall

public java.lang.Object prepareCall(SObjFunction obj,
                                    SContext context,
                                    java.lang.Object[] args)
                             throws STeaException

commit

public java.lang.Object commit(SObjFunction obj,
                               SContext context,
                               java.lang.Object[] args)
                        throws STeaException
Commits the transaction bound to this connection. The transaction was implicitly started at the last call to commit() or rollback() or at the time the connection was established, whatever happened last.
Throws:
STeaException - Thrown if there were any problems commiting the transaction or if there is no connection yet.

autocommit

public java.lang.Object autocommit(SObjFunction obj,
                                   SContext context,
                                   java.lang.Object[] args)
                            throws SRuntimeException

rollback

public java.lang.Object rollback(SObjFunction obj,
                                 SContext context,
                                 java.lang.Object[] args)
                          throws SRuntimeException

close

public java.lang.Object close(SObjFunction obj,
                              SContext context,
                              java.lang.Object[] args)
                       throws STeaException

closedEvent

public void closedEvent(java.lang.Object closedObject)
Description copied from interface: com.pdmfc.tea.modules.tdbc.SClosedEventListener
Signals that an object has been closed.
Specified by:
closedEvent in interface com.pdmfc.tea.modules.tdbc.SClosedEventListener
Following copied from interface: com.pdmfc.tea.modules.tdbc.SClosedEventListener
Parameters:
closedObject - The object that was closed.

Tea Java Runtime API
Version 3.1.0

© 2002 PDM&FC, All Rights Reserved.