Tea Java Runtime API
Version 3.2.4

com.pdmfc.tea.modules.tdbc
Class SConnection

java.lang.Object
  extended by com.pdmfc.tea.modules.tos.STosObj
      extended by com.pdmfc.tea.modules.tdbc.SConnection
All Implemented Interfaces:
SObjFunction

public class SConnection
extends STosObj

Implements an TOS object that acts like a java.sql.Connection.


Method Summary
 void addClosedListener(SClosedEventListener listener)
          Registers a listener that is notified when this database connection is closed.
 java.lang.Object autocommit(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "autocommit" TOS method.
 java.lang.Object close(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "close" TOS method.
 java.lang.Object commit(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "commit" TOS method.
 java.lang.Object connect(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "connect" TOS method.
 java.lang.Object constructor(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "constructor" TOS method.
 java.sql.Connection getInternalConnection()
          Fetches the java.sql.Connection used to interact with the database.
static java.lang.String getTosClassName()
          Retrieves the recomended name for the TOS class.
static SConnection newInstance(SContext context, java.sql.Connection connection)
          Creates a TOS TConnection instance and supplies an external java.sql.Connection to associate with.
 java.lang.Object prepare(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "prepare" TOS method.
 java.lang.Object prepareCall(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "prepareCall" TOS method.
 java.lang.Object rollback(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "rollback" TOS method.
 java.lang.Object statement(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "statement" TOS method.
 
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
 

Method Detail

getInternalConnection

public java.sql.Connection getInternalConnection()
Fetches the java.sql.Connection used to interact with the database.

Returns:
The java.sql.Connection being used.

getTosClassName

public static java.lang.String getTosClassName()
Retrieves the recomended name for the TOS class.

Returns:
The name for the TOS class.

addClosedListener

public void addClosedListener(SClosedEventListener listener)
Registers a listener that is notified when this database connection is closed.

Parameters:
listener - The listener to notify at close time.

constructor

public java.lang.Object constructor(SObjFunction obj,
                                    SContext context,
                                    java.lang.Object[] args)
                             throws STeaException
The implementation for the "constructor" TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.
Throws:
STeaException

connect

public java.lang.Object connect(SObjFunction obj,
                                SContext context,
                                java.lang.Object[] args)
                         throws STeaException
The implementation for the "connect" TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.
Throws:
STeaException

statement

public java.lang.Object statement(SObjFunction obj,
                                  SContext context,
                                  java.lang.Object[] args)
                           throws STeaException
The implementation for the "statement" TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.
Throws:
STeaException

prepare

public java.lang.Object prepare(SObjFunction obj,
                                SContext context,
                                java.lang.Object[] args)
                         throws STeaException
The implementation for the "prepare" TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.
Throws:
STeaException

prepareCall

public java.lang.Object prepareCall(SObjFunction obj,
                                    SContext context,
                                    java.lang.Object[] args)
                             throws STeaException
The implementation for the "prepareCall" TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.
Throws:
STeaException

commit

public java.lang.Object commit(SObjFunction obj,
                               SContext context,
                               java.lang.Object[] args)
                        throws STeaException
The implementation for the "commit" TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.
Throws:
STeaException

autocommit

public java.lang.Object autocommit(SObjFunction obj,
                                   SContext context,
                                   java.lang.Object[] args)
                            throws SRuntimeException
The implementation for the "autocommit" TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.
Throws:
SRuntimeException

rollback

public java.lang.Object rollback(SObjFunction obj,
                                 SContext context,
                                 java.lang.Object[] args)
                          throws SRuntimeException
The implementation for the "rollback" TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.
Throws:
SRuntimeException

close

public java.lang.Object close(SObjFunction obj,
                              SContext context,
                              java.lang.Object[] args)
                       throws STeaException
The implementation for the "close" TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.
Throws:
STeaException

newInstance

public static SConnection newInstance(SContext context,
                                      java.sql.Connection connection)
                               throws STeaException
Creates a TOS TConnection instance and supplies an external java.sql.Connection to associate with. This java.sql.Connection is not closed when the close(SObjFunction,SContext,Object[]) method (i.e. the close TOS method) is called. It is the responsability of the caller to eventually close the supplied java.sql.Connection.

The caller may be notified of when the TConnection is closed by registering an apropriate SClosedEventListener through the addClosedListener(SClosedEventListener) method. When the TConnection gets closed the SClosedEventListener.closedEvent(Object) is called having as argument the apropriate SConnection.

Parameters:
context - The context where the Tea TConnection object is being created.
connection - The java.sqlConnection to associate with the TConnection being created.
Returns:
A newly created and initialized SConnection instance.
Throws:
STeaException

Tea Java Runtime API
Version 3.2.4

© 2009 PDM&FC, All Rights Reserved.