Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

recoin.group.adapter
Class JDBCSingleAdapter  view JDBCSingleAdapter download JDBCSingleAdapter.java

java.lang.Object
  extended byrecoin.group.ComponentWorker
      extended byrecoin.group.adapter.JDBCAdapter
          extended byrecoin.group.adapter.JDBCSingleAdapter

public abstract class JDBCSingleAdapter
extends JDBCAdapter

The JDBCSingleAdapter provides methods to create connections to a datasource. The connections are closed after each transaction which means new connections have to be generated for every task.
It extends the JDBCAdapter class that prepares the necessary attributes needed to establish the connection.

Version:
0.2.9

Field Summary
protected  java.sql.Connection connection
          The connection to the datasource.
(package private) static org.apache.log4j.Logger logger
          The logger for this class.
 
Fields inherited from class recoin.group.adapter.JDBCAdapter
databaseName, driverName, jdbcURL, password, port, serverName, user
 
Fields inherited from class recoin.group.ComponentWorker
component
 
Constructor Summary
JDBCSingleAdapter()
          Creates a new JDBCSingleAdapter.
 
Method Summary
protected  java.sql.Connection getConnection(java.lang.String url)
          Returns a new Connection for the specified URL.
protected  java.sql.Connection getConnection(java.lang.String url, java.lang.String u, java.lang.String p)
          Returns a new Connection for the specified URL using the specified user name and password for authentication.
 
Methods inherited from class recoin.group.adapter.JDBCAdapter
initiate
 
Methods inherited from class recoin.group.ComponentWorker
createComponentRunnable, createComponentRunnable, createComponentRunnable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

static org.apache.log4j.Logger logger
The logger for this class.


connection

protected java.sql.Connection connection
The connection to the datasource.

Constructor Detail

JDBCSingleAdapter

public JDBCSingleAdapter()
Creates a new JDBCSingleAdapter.

Method Detail

getConnection

protected java.sql.Connection getConnection(java.lang.String url)
                                     throws recoin.exception.ComponentWorkerException
Returns a new Connection for the specified URL.

Specified by:
getConnection in class JDBCAdapter

getConnection

protected java.sql.Connection getConnection(java.lang.String url,
                                            java.lang.String u,
                                            java.lang.String p)
                                     throws recoin.exception.ComponentWorkerException
Returns a new Connection for the specified URL using the specified user name and password for authentication.

Specified by:
getConnection in class JDBCAdapter