Package de.hybris.platform.jdbcwrapper
Interface HybrisDataSource
-
- All Superinterfaces:
javax.sql.CommonDataSource
,javax.sql.DataSource
,java.sql.Wrapper
- All Known Implementing Classes:
DataSourceImpl
,SlaveTenantDataSource
public interface HybrisDataSource extends javax.sql.DataSource
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
cannotConnect()
void
destroy()
java.sql.Connection
getConnection(boolean transactionBound)
java.util.Map<java.lang.String,java.lang.String>
getConnectionParameters()
JDBCConnectionPool
getConnectionPool()
java.lang.String
getCustomSessionSQL()
java.lang.String
getDatabaseName()
java.lang.String
getDatabaseURL()
java.lang.String
getDatabaseUser()
java.lang.String
getDatabaseVersion()
DataSourceFactory
getDataSourceFactory()
java.lang.String
getDriverVersion()
java.lang.String
getID()
JDBCInterceptor
getJDBCInterceptor()
java.lang.String
getJNDIName()
JDBCLogUtils
getLogUtils()
int
getMaxAllowedPhysicalOpen()
int
getMaxInUse()
int
getMaxPhysicalOpen()
int
getMaxPreparedParameterCount()
long
getMillisWaitedForConnection()
int
getNumInUse()
int
getNumPhysicalOpen()
java.lang.String
getSchemaName()
java.lang.String
getTablePrefix()
Tenant
getTenant()
void
invalidate(ConnectionImpl conn)
boolean
isDBLogActive()
boolean
isDBLogAppendStackTraceActive()
boolean
isReadOnly()
void
resetStats()
Reset the statistics.void
returnToPool(ConnectionImpl conn)
void
setDBLog(boolean active)
void
setDBLogAppendStackTrace(boolean active)
long
totalGets()
org.springframework.dao.DataAccessException
translateToDataAccessException(java.sql.SQLException e)
Translates the given raw SQL exception into a SpringDataAccessException
exactly like it would have been done when using SpringJdbcTemplate
.-
Methods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilder, getParentLogger
-
-
-
-
Method Detail
-
getDataSourceFactory
DataSourceFactory getDataSourceFactory()
-
getDriverVersion
java.lang.String getDriverVersion()
- Returns:
- the database driver version
-
getConnectionParameters
java.util.Map<java.lang.String,java.lang.String> getConnectionParameters()
-
getJNDIName
java.lang.String getJNDIName()
- Returns:
- the JNDI name
-
getID
java.lang.String getID()
- Returns:
- the ID of the current data source
-
getConnectionPool
JDBCConnectionPool getConnectionPool()
-
getTenant
Tenant getTenant()
-
getConnection
java.sql.Connection getConnection(boolean transactionBound) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
returnToPool
void returnToPool(ConnectionImpl conn)
-
invalidate
void invalidate(ConnectionImpl conn)
-
destroy
void destroy()
-
getNumInUse
int getNumInUse()
- Returns:
- the number of instances currently borrowed from the pool.
-
getNumPhysicalOpen
int getNumPhysicalOpen()
- Returns:
- number of currently open JDBC connections.
-
getMaxInUse
int getMaxInUse()
- Returns:
- the maximum number of the 'in use' connection
-
getMaxPhysicalOpen
int getMaxPhysicalOpen()
- Returns:
- the maximum number of physical SQL connections.
-
totalGets
long totalGets()
- Returns:
- Total number of connections so far. Reset with
resetStats()
-
getMaxAllowedPhysicalOpen
int getMaxAllowedPhysicalOpen()
- Returns:
- the maximum number of objects that can be allocated by the pool
-
getMillisWaitedForConnection
long getMillisWaitedForConnection()
- Returns:
- the time in milliseconds how long it took to get a connection from the pool
-
resetStats
void resetStats()
-
getLogUtils
JDBCLogUtils getLogUtils()
-
getDatabaseName
java.lang.String getDatabaseName()
- Returns:
- the database name
-
getMaxPreparedParameterCount
int getMaxPreparedParameterCount()
- Returns:
- the maximum allowed number of parameters within one prepared statement; -1 if no limit exists
-
getDatabaseVersion
java.lang.String getDatabaseVersion()
- Returns:
- the database version
-
getDatabaseURL
java.lang.String getDatabaseURL()
- Returns:
- the URL of the database
-
getCustomSessionSQL
java.lang.String getCustomSessionSQL()
-
getDatabaseUser
java.lang.String getDatabaseUser()
- Returns:
- the database user
-
getSchemaName
java.lang.String getSchemaName()
- Returns:
- the schema name of the database
-
cannotConnect
boolean cannotConnect()
- Returns:
true
if a connection the pool is not possible.
-
isDBLogActive
boolean isDBLogActive()
-
isDBLogAppendStackTraceActive
boolean isDBLogAppendStackTraceActive()
-
setDBLog
void setDBLog(boolean active)
-
setDBLogAppendStackTrace
void setDBLogAppendStackTrace(boolean active)
-
isReadOnly
boolean isReadOnly()
- Returns:
true
if the datasoure is read-only
-
getTablePrefix
java.lang.String getTablePrefix()
- Returns:
- the table prefix for all tables
-
translateToDataAccessException
org.springframework.dao.DataAccessException translateToDataAccessException(java.sql.SQLException e)
Translates the given raw SQL exception into a SpringDataAccessException
exactly like it would have been done when using SpringJdbcTemplate
.
-
getJDBCInterceptor
JDBCInterceptor getJDBCInterceptor()
-
-