public class SpringDataSourceAdapter extends Object
Modifier and Type | Field and Description |
---|---|
protected String |
contextName |
protected HandleableException |
handlerException |
protected org.slf4j.Logger |
LOG |
Constructor and Description |
---|
SpringDataSourceAdapter(DataSource ds,
String contextName) |
Modifier and Type | Method and Description |
---|---|
void |
close(CallableStatement call)
null-safe close CallableStatement. |
void |
close(ConnectionAdapter conn)
null-safe close connection. |
void |
close(PreparedStatement stmt)
null-safe close PreparedStatement. |
void |
close(ResultSet rs)
null-safe close ResultSet. |
void |
close(Statement stmt)
null-safe close Statement. |
String |
getContextName()
Name from repository context
|
Transactional |
getTransactionManager()
Create new Transaction Manager for JDBC transactions
|
ConnectionAdapter |
open()
Attempts to establish a connection to the database
|
ConnectionAdapter |
open(Isolation isolation)
Attempts to establish a connection to the database with specific isolation
|
protected void |
setIsolation(Connection conn,
Isolation isolation) |
protected boolean |
supportsTransactionIsolationLevel(Connection conn,
Isolation isolation) |
ConnectionFactory |
with(HandleableException handlerException) |
protected transient org.slf4j.Logger LOG
protected final String contextName
protected HandleableException handlerException
public SpringDataSourceAdapter(DataSource ds, String contextName)
public ConnectionAdapter open()
ConnectionFactory
public ConnectionAdapter open(Isolation isolation)
ConnectionFactory
isolation
- isolation level from transactionpublic void close(ConnectionAdapter conn)
ConnectionFactory
null-safe
close connection.
Throws SQLException
is logged as warning.close
in interface ConnectionFactory
conn
- connection to closepublic ConnectionFactory with(HandleableException handlerException)
with
in interface ConnectionFactory
public String getContextName()
ConnectionFactory
getContextName
in interface ConnectionFactory
public Transactional getTransactionManager()
ConnectionFactory
getTransactionManager
in interface ConnectionFactory
public void close(PreparedStatement stmt)
ConnectionFactory
null-safe
close PreparedStatement.
Throws SQLException
is logged as warning.close
in interface ConnectionFactory
stmt
- statement to closepublic void close(Statement stmt)
ConnectionFactory
null-safe
close Statement.
Throws SQLException
is logged as warning.close
in interface ConnectionFactory
stmt
- statement to closepublic void close(ResultSet rs)
ConnectionFactory
null-safe
close ResultSet.
Throws SQLException
is logged as warning.close
in interface ConnectionFactory
rs
- ResultSet to closepublic void close(CallableStatement call)
ConnectionFactory
null-safe
close CallableStatement.
Throws SQLException
is logged as warning.close
in interface ConnectionFactory
call
- CallableStatement to closeprotected void setIsolation(Connection conn, Isolation isolation)
protected boolean supportsTransactionIsolationLevel(Connection conn, Isolation isolation)
Copyright © 2012–2020 jkniv, copyleft code. All rights reserved.