com.objectwave.persist.broker
Class EjbConnectionSource

java.lang.Object
  |
  +--com.objectwave.persist.broker.AbstractConnectionFactory
        |
        +--com.objectwave.persist.broker.EjbConnectionSource
All Implemented Interfaces:
SqlConnectionFactory

public class EjbConnectionSource
extends AbstractConnectionFactory
implements SqlConnectionFactory

The connectUrl will be the DataSource JNDI name.

Version:
$Id: EjbConnectionSource.java,v 2.2 2001/10/04 19:42:17 dave_hoag Exp $
Author:
dhoag

Field Summary
static java.lang.String DEFAULT_DATASOURCE
           
 
Constructor Summary
EjbConnectionSource()
          Constructor for the EjbConnectionSource object
 
Method Summary
 java.sql.Connection checkConnection(RDBConnection jgrinderConnection)
          Create or retrieve the connection to use for accessing the database.
 void freeConnection(RDBConnection jgrinderConnection, java.sql.Connection connection)
          Release the connection back into the wild.
 java.sql.Connection getEjbConnection(RDBConnection jgrinderConnection)
          Lookup the DataSource from the JNDI location.
 
Methods inherited from class com.objectwave.persist.broker.AbstractConnectionFactory
checkForWarning, freeNormalConnection, logConnectionStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DATASOURCE

public static final java.lang.String DEFAULT_DATASOURCE
See Also:
Constant Field Values
Constructor Detail

EjbConnectionSource

public EjbConnectionSource()
Constructor for the EjbConnectionSource object

Method Detail

getEjbConnection

public java.sql.Connection getEjbConnection(RDBConnection jgrinderConnection)
                                     throws java.lang.Exception
Lookup the DataSource from the JNDI location. From the DataSource, create a new connection object.

Parameters:
jgrinderConnection -
Returns:
The EjbConnection value
Throws:
java.lang.Exception

checkConnection

public java.sql.Connection checkConnection(RDBConnection jgrinderConnection)
                                    throws java.sql.SQLException
Description copied from interface: SqlConnectionFactory
Create or retrieve the connection to use for accessing the database.

Specified by:
checkConnection in interface SqlConnectionFactory
Parameters:
jgrinderConnection -
Returns:
Throws:
java.sql.SQLException

freeConnection

public void freeConnection(RDBConnection jgrinderConnection,
                           java.sql.Connection connection)
Description copied from interface: SqlConnectionFactory
Release the connection back into the wild.

Specified by:
freeConnection in interface SqlConnectionFactory
Parameters:
jgrinderConnection -
connection -