Package de.hybris.platform.jdbcwrapper
Interface HybrisDataSource
- All Superinterfaces:
CommonDataSource,DataSource,Wrapper
- All Known Implementing Classes:
DataSourceImpl,SlaveTenantDataSource
-
Method Summary
Modifier and TypeMethodDescriptionbooleanvoiddestroy()getConnection(boolean transactionBound) getID()intintintintlongintintdefault intvoidinvalidate(ConnectionImpl conn) booleanbooleanbooleanvoidReset the statistics.voidreturnToPool(ConnectionImpl conn) voidsetDBLog(boolean active) voidsetDBLogAppendStackTrace(boolean active) longorg.springframework.dao.DataAccessExceptionTranslates the given raw SQL exception into a SpringDataAccessExceptionexactly like it would have been done when using SpringJdbcTemplate.Methods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilder, getParentLoggerMethods inherited from interface javax.sql.DataSource
createConnectionBuilder, getConnection, getConnection, getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriterMethods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
-
Method Details
-
getDataSourceFactory
DataSourceFactory getDataSourceFactory() -
getDriverVersion
String getDriverVersion()- Returns:
- the database driver version
-
getConnectionParameters
-
getJNDIName
String getJNDIName()- Returns:
- the JNDI name
-
getID
String getID()- Returns:
- the ID of the current data source
-
getConnectionPool
JDBCConnectionPool getConnectionPool() -
getTenant
Tenant getTenant() -
getConnection
- Throws:
SQLException
-
returnToPool
-
invalidate
-
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.
-
getNumReadOnlyOpen
default int getNumReadOnlyOpen()- Returns:
- number of open connections that are read-only
-
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
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
String getDatabaseVersion()- Returns:
- the database version
-
getDatabaseURL
String getDatabaseURL()- Returns:
- the URL of the database
-
getCustomSessionSQL
String getCustomSessionSQL() -
getDatabaseUser
String getDatabaseUser()- Returns:
- the database user
-
getSchemaName
String getSchemaName()- Returns:
- the schema name of the database
-
cannotConnect
boolean cannotConnect()- Returns:
trueif 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:
trueif the datasoure is read-only
-
getTablePrefix
String getTablePrefix()- Returns:
- the table prefix for all tables
-
translateToDataAccessException
Translates the given raw SQL exception into a SpringDataAccessExceptionexactly like it would have been done when using SpringJdbcTemplate. -
getJDBCInterceptor
JDBCInterceptor getJDBCInterceptor()
-