net.anotheria.db.service
Class BasePersistenceServiceJDBCImpl

java.lang.Object
  extended by net.anotheria.db.service.BasePersistenceServiceJDBCImpl
Direct Known Subclasses:
DBUtil, GenericPersistenceService

public abstract class BasePersistenceServiceJDBCImpl
extends Object

Base persistence service.


Field Summary
protected  org.slf4j.Logger log
          Logger.
 
Constructor Summary
protected BasePersistenceServiceJDBCImpl()
          Default constructor.
protected BasePersistenceServiceJDBCImpl(String aConfigName)
           
 
Method Summary
protected  void close(Connection conn)
          Close Connection if it opened.
protected  void close(ResultSet rs)
          Close ResultSet if it opened.
protected  void close(Statement st)
          Close Statement if it opened.
protected  Connection getConnection()
          Get connection from pool.
 void init()
          Initialize data source.
protected  void release(Connection conn)
          Close Connection if it opened.
protected  void release(ResultSet rs)
          Close ResultSet if it opened.
protected  void release(Statement st)
          Close Statement if it opened.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected org.slf4j.Logger log
Logger.

Constructor Detail

BasePersistenceServiceJDBCImpl

protected BasePersistenceServiceJDBCImpl()
Default constructor.


BasePersistenceServiceJDBCImpl

protected BasePersistenceServiceJDBCImpl(String aConfigName)
Method Detail

init

public void init()
Initialize data source.


getConnection

protected Connection getConnection()
                            throws SQLException
Get connection from pool.

Returns:
Connection
Throws:
SQLException

close

protected void close(Connection conn)
Close Connection if it opened. If SQLException happen on closing it will be logged.

Parameters:
conn - - Connection object

close

protected void close(Statement st)
Close Statement if it opened. If SQLException happen on closing it will be logged.

Parameters:
st - - Statement object

close

protected void close(ResultSet rs)
Close ResultSet if it opened. If SQLException happen on closing it will be logged.

Parameters:
st - - ResultSet object

release

protected void release(Connection conn)
Close Connection if it opened. If SQLException happen on closing it will be logged.

Parameters:
conn - - Connection object

release

protected void release(Statement st)
Close Statement if it opened. If SQLException happen on closing it will be logged.

Parameters:
st - - Statement object

release

protected void release(ResultSet rs)
Close ResultSet if it opened. If SQLException happen on closing it will be logged.

Parameters:
st - - ResultSet object


Copyright © 2010-2013 anotheria.net. All Rights Reserved.