public class JdbcConnection extends AbstractConnection
AbstractConnection.StatementCounter| Modifier and Type | Field and Description |
|---|---|
static String |
AUTOCOMMIT_KEY |
static String |
AUTOCOMMIT_SIZE_KEY |
protected int |
autocommitSize |
static String |
FLUSH_BEFORE_QUERY |
protected boolean |
flushBeforeQuery |
protected boolean |
keepformat |
static String |
KEEPFORMAT_KEY |
protected String |
separator |
protected boolean |
separatorSingleLine |
static String |
STATEMENT_BATCH_SIZE |
static String |
STATEMENT_CACHE_KEY |
static String |
STATEMENT_FETCH_SIZE |
static String |
STATEMENT_SEPARATOR_KEY |
static String |
STATEMENT_SEPARATOR_SINGLELINE_KEY |
protected int |
statementBatchSize |
protected int |
statementCacheSize |
protected int |
statementFetchSize |
static String |
TRANSACTION_ISOLATION_KEY |
static String |
TRANSACTION_ISOLATION_READ_COMMITTED |
static String |
TRANSACTION_ISOLATION_READ_UNCOMMITTED |
static String |
TRANSACTION_ISOLATION_REPEATABLE_READ |
static String |
TRANSACTION_ISOLATION_SERIALIZABLE |
counter| Constructor and Description |
|---|
JdbcConnection(Connection con,
ConnectionParameters parameters) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the connection and releases all related resources.
|
void |
commit()
Commits a current transaction (if any).
|
void |
executeQuery(Resource queryContent,
ParametersCallback parametersCallback,
QueryCallback queryCallback)
Executes a query specified by its content.
|
void |
executeScript(Resource scriptContent,
ParametersCallback parametersCallback)
Executes a script specified by its content.
|
void |
flush() |
Connection |
getNativeConnection() |
protected void |
init(ConnectionParameters parameters)
Called in constructor
|
protected void |
initDialectIdentifier()
Initializes dialect identifier for connection.
|
protected scriptella.jdbc.StatementCache |
newStatementCache()
Creates an instance of statement cache.
|
void |
rollback()
Rolls back a current transaction (if any).
|
String |
toString() |
getDialectIdentifier, getExecutedStatementsCount, isReadonly, setDialectIdentifierpublic static final String STATEMENT_CACHE_KEY
public static final String STATEMENT_SEPARATOR_KEY
public static final String STATEMENT_SEPARATOR_SINGLELINE_KEY
public static final String STATEMENT_BATCH_SIZE
public static final String STATEMENT_FETCH_SIZE
public static final String KEEPFORMAT_KEY
public static final String AUTOCOMMIT_KEY
public static final String AUTOCOMMIT_SIZE_KEY
public static final String FLUSH_BEFORE_QUERY
public static final String TRANSACTION_ISOLATION_KEY
public static final String TRANSACTION_ISOLATION_READ_UNCOMMITTED
public static final String TRANSACTION_ISOLATION_READ_COMMITTED
public static final String TRANSACTION_ISOLATION_REPEATABLE_READ
public static final String TRANSACTION_ISOLATION_SERIALIZABLE
protected int statementCacheSize
protected int statementBatchSize
protected int statementFetchSize
protected boolean flushBeforeQuery
protected String separator
protected boolean separatorSingleLine
protected boolean keepformat
protected int autocommitSize
public JdbcConnection(Connection con, ConnectionParameters parameters)
protected void init(ConnectionParameters parameters)
parameters - connection parameters.protected void initDialectIdentifier()
DialectIdentifier.NULL_DIALECT is used.
May be overriden by subclasses.
public void executeScript(Resource scriptContent, ParametersCallback parametersCallback)
ConnectionscriptContent may be used as a key for caching purposes, i.e.
provider may precompile scripts and use compiled versions for subsequent executions.
Please note that only inline text resources
can be safely cached.
scriptContent - script content. Cannot be null.parametersCallback - callback to get parameter values. Cannot be null.public void executeQuery(Resource queryContent, ParametersCallback parametersCallback, QueryCallback queryCallback)
ConnectionqueryContent - query content. Cannot be null.parametersCallback - callback to get parameter values. Cannot be null.queryCallback - callback to call for each result set element produced by this query. Cannot be null.Connection.executeScript(scriptella.spi.Resource,scriptella.spi.ParametersCallback)protected scriptella.jdbc.StatementCache newStatementCache()
public void commit()
ConnectionThrowing an error during commit phase cause rollback.
commit in interface Connectioncommit in class AbstractConnectionpublic void rollback()
Connectionrollback in interface Connectionrollback in class AbstractConnectionpublic void flush()
throws ProviderException
ProviderExceptionpublic void close()
Connectionpublic Connection getNativeConnection()
public String toString()
toString in interface ConnectiontoString in class AbstractConnectionCopyright © 2006-2012. All Rights Reserved.