public class DefaultDbConnection extends Object implements DbConnection
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
logger |
protected static int |
UNKNOWN_DATA_TYPE |
| Constructor and Description |
|---|
DefaultDbConnection(Connection jdbcConnection,
List<DbType> customDataTypes) |
| Modifier and Type | Method and Description |
|---|---|
void |
abortActiveLobStreams()
Resets the count of the returned results that are streams that still need to be consumed.
|
void |
begin() |
void |
beginStreaming()
Starts streaming.
|
void |
commit() |
Array |
createArrayOf(String typeName,
Object[] elements)
|
Struct |
createStruct(String typeName,
Object[] attributes)
|
void |
decrementActiveLobStreams()
Decrements the count of the returned results that are streams that need to be consumed.
|
void |
doResolveLobIn(Object[] attributes,
int index,
int dataType,
String dataTypeName) |
void |
doResolveLobIn(Object[] attributes,
int index,
String dataTypeName) |
void |
endStreaming()
Marks that the streaming is over
|
List<DbType> |
getCustomDataTypes() |
Connection |
getJdbcConnection() |
protected Map<Integer,ResolvedDbType> |
getLobFieldsDataTypeInfo(String typeName) |
DatabaseMetaData |
getMetaData() |
StatementResultIteratorFactory |
getStatementResultIteratorFactory(ResultSetHandler resultSetHandler)
Returns the
StatementResultIteratorFactory used to create the StatementResultIterator for this connection. |
List<DbType> |
getVendorDataTypes() |
boolean |
hasActiveLobStreams()
Finds out if there are open LOB streams in the results that need to be consumed.
|
void |
incrementActiveLobStreams()
Increments the count of the returned results that are streams that need to be consumed.
|
boolean |
isStreaming() |
boolean |
isTransactionActive() |
PreparedStatement |
prepareStatement(String sql) |
void |
release()
Closes the underlying JDBC connection, provided that
DbConnection.isStreaming() is false |
protected void |
resolveLobs(String typeName,
Object[] attributes,
StructAndArrayTypeResolver typeResolver) |
void |
rollback() |
boolean |
supportsContentStreaming() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateArrayOf, getDbTypeByVendor, getProcedureColumns, getProcedureColumnType, getTablesprotected static final int UNKNOWN_DATA_TYPE
protected static final org.slf4j.Logger logger
public DefaultDbConnection(Connection jdbcConnection, List<DbType> customDataTypes)
public StatementResultIteratorFactory getStatementResultIteratorFactory(ResultSetHandler resultSetHandler)
StatementResultIteratorFactory used to create the StatementResultIterator for this connection.getStatementResultIteratorFactory in interface DbConnectionresultSetHandler - used to process resultSets created from this connectionStatementResultIterator for this connection.public List<DbType> getVendorDataTypes()
getVendorDataTypes in interface DbConnectionDbTypes which are specific to the Database vendorpublic Connection getJdbcConnection()
getJdbcConnection in interface DbConnectionpublic List<DbType> getCustomDataTypes()
getCustomDataTypes in interface DbConnectionDbTypespublic void begin()
throws org.mule.runtime.api.tx.TransactionException
begin in interface org.mule.runtime.extension.api.tx.Transactionalorg.mule.runtime.api.tx.TransactionExceptionpublic void commit()
throws org.mule.runtime.api.tx.TransactionException
commit in interface org.mule.runtime.extension.api.tx.Transactionalorg.mule.runtime.api.tx.TransactionExceptionpublic void rollback()
throws org.mule.runtime.api.tx.TransactionException
rollback in interface org.mule.runtime.extension.api.tx.Transactionalorg.mule.runtime.api.tx.TransactionExceptionpublic void release()
DbConnection.isStreaming() is falserelease in interface DbConnectionpublic void beginStreaming()
DbConnectionthis connection is about to be
iteratedbeginStreaming in interface DbConnectionpublic boolean isStreaming()
isStreaming in interface DbConnectionDbConnection.beginStreaming() has been invoked on this instance but DbConnection.endStreaming() has notpublic void endStreaming()
DbConnectionendStreaming in interface DbConnectionpublic boolean isTransactionActive()
isTransactionActive in interface DbConnectionpublic boolean supportsContentStreaming()
supportsContentStreaming in interface DbConnectionpublic void incrementActiveLobStreams()
DbConnectionincrementActiveLobStreams in interface DbConnectionpublic void decrementActiveLobStreams()
DbConnectiondecrementActiveLobStreams in interface DbConnectionpublic void abortActiveLobStreams()
DbConnectionabortActiveLobStreams in interface DbConnectionpublic boolean hasActiveLobStreams()
DbConnectionhasActiveLobStreams in interface DbConnectionpublic PreparedStatement prepareStatement(String sql) throws SQLException
SQLExceptionpublic Array createArrayOf(String typeName, Object[] elements) throws SQLException
DbConnectioncreateArrayOf in interface DbConnectiontypeName - The Array type nameelements - The values to convert to an ArrayArraySQLException - if an error occurs trying to create the array.public Struct createStruct(String typeName, Object[] attributes) throws SQLException
DbConnectioncreateStruct in interface DbConnectiontypeName - The Struct type nameattributes - The values to convert to an StructStructSQLException - if an error occurs trying to create the struct.public DatabaseMetaData getMetaData() throws SQLException
SQLExceptionprotected void resolveLobs(String typeName, Object[] attributes, StructAndArrayTypeResolver typeResolver) throws SQLException
SQLExceptionprotected Map<Integer,ResolvedDbType> getLobFieldsDataTypeInfo(String typeName) throws SQLException
SQLExceptionpublic void doResolveLobIn(Object[] attributes, int index, int dataType, String dataTypeName) throws SQLException
SQLExceptionpublic void doResolveLobIn(Object[] attributes, int index, String dataTypeName) throws SQLException
SQLExceptionCopyright © 2021. All rights reserved.