Package net.sf.jkniv.whinstone
Interface ConnectionFactory
-
public interface ConnectionFactoryResponsible to open connections with a specific database, could be a DataSource, DriverManager, SpringDataSource manager...- Author:
- Alisson Gomes
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose(CallableStatement call)null-safeclose CallableStatement.voidclose(PreparedStatement stmt)null-safeclose PreparedStatement.voidclose(ResultSet rs)null-safeclose ResultSet.voidclose(Statement stmt)null-safeclose Statement.voidclose(ConnectionAdapter conn)null-safeclose connection.StringgetContextName()Name from repository contextTransactionalgetTransactionManager()Create new Transaction Manager for JDBC transactionsConnectionAdapteropen()Attempts to establish a connection to the databaseConnectionAdapteropen(net.sf.jkniv.sqlegance.transaction.Isolation isolation)Attempts to establish a connection to the database with specific isolationConnectionFactorywith(net.sf.jkniv.exception.HandleableException handlerException)
-
-
-
Method Detail
-
open
ConnectionAdapter open()
Attempts to establish a connection to the database- Returns:
- a Connection from the URL or DataSource
- Throws:
net.sf.jkniv.sqlegance.RepositoryException- if cannot establish a connection
-
with
ConnectionFactory with(net.sf.jkniv.exception.HandleableException handlerException)
-
open
ConnectionAdapter open(net.sf.jkniv.sqlegance.transaction.Isolation isolation)
Attempts to establish a connection to the database with specific isolation- Parameters:
isolation- isolation level from transaction- Returns:
- a Connection from the URL or DataSource
- Throws:
net.sf.jkniv.sqlegance.RepositoryException- if cannot establish a connection
-
getTransactionManager
Transactional getTransactionManager()
Create new Transaction Manager for JDBC transactions- Returns:
- a LOCAL, GLOBAL or EJB transaction manager.
-
getContextName
String getContextName()
Name from repository context- Returns:
- name of context
-
close
void close(ConnectionAdapter conn)
null-safeclose connection. ThrowsSQLExceptionis logged as warning.- Parameters:
conn- connection to close
-
close
void close(PreparedStatement stmt)
null-safeclose PreparedStatement. ThrowsSQLExceptionis logged as warning.- Parameters:
stmt- statement to close
-
close
void close(Statement stmt)
null-safeclose Statement. ThrowsSQLExceptionis logged as warning.- Parameters:
stmt- statement to close
-
close
void close(ResultSet rs)
null-safeclose ResultSet. ThrowsSQLExceptionis logged as warning.- Parameters:
rs- ResultSet to close
-
close
void close(CallableStatement call)
null-safeclose CallableStatement. ThrowsSQLExceptionis logged as warning.- Parameters:
call- CallableStatement to close
-
-