com.eurotech.framework.db
Interface DbService


public interface DbService

DbService offers APIs to acquire and use a JDBC Connection to the embedded SQL database running in the framework. The configuration of the DbService will determine the configuration of the embedded SQL database. The usage of API is typical for JDBC Connections; the connection is first acquired with getConnection(), and it must be released when the operation is completed with close(). The implementation of the DbService and the returned JdbcConnection will manage the concurrent access into the database appropriately.


Method Summary
 void close(Connection conn)
          Releases a previously acquired JDCB connection to the DbService.
 void close(ResultSet... rss)
          Utility method to silently close a JDBC ResultSet without throwing SQLExcepton.
 void close(Statement... stmts)
          Utility method to silently close a JDBC Statement without throwing SQLExcepton.
 Connection getConnection()
          Returns the JDBC Connection to be used to communicate with the embedded SQL database.
 void rollback(Connection conn)
          Utility method to silently rollback a JDBC Connection without throwing SQLExcepton.
 

Method Detail

getConnection

Connection getConnection()
                         throws SQLException
Returns the JDBC Connection to be used to communicate with the embedded SQL database. For each acquired connection, the DbService.close() method must be called.

Returns:
Connection to be used
Throws:
SQLException

close

void close(Connection conn)
Releases a previously acquired JDCB connection to the DbService.

Parameters:
conn - to be released

rollback

void rollback(Connection conn)
Utility method to silently rollback a JDBC Connection without throwing SQLExcepton. The method will catch any SQLExcepton thrown and log it.


close

void close(ResultSet... rss)
Utility method to silently close a JDBC ResultSet without throwing SQLExcepton. The method will catch any SQLExcepton thrown and log it.


close

void close(Statement... stmts)
Utility method to silently close a JDBC Statement without throwing SQLExcepton. The method will catch any SQLExcepton thrown and log it.



Copyright © 2013. All Rights Reserved.