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 booleancannotConnect()voiddestroy()java.sql.ConnectiongetConnection(boolean transactionBound)java.util.Map<java.lang.String,java.lang.String>getConnectionParameters()JDBCConnectionPoolgetConnectionPool()java.lang.StringgetCustomSessionSQL()java.lang.StringgetDatabaseName()java.lang.StringgetDatabaseURL()java.lang.StringgetDatabaseUser()java.lang.StringgetDatabaseVersion()DataSourceFactorygetDataSourceFactory()java.lang.StringgetDriverVersion()java.lang.StringgetID()JDBCInterceptorgetJDBCInterceptor()java.lang.StringgetJNDIName()JDBCLogUtilsgetLogUtils()intgetMaxAllowedPhysicalOpen()intgetMaxInUse()intgetMaxPhysicalOpen()intgetMaxPreparedParameterCount()longgetMillisWaitedForConnection()intgetNumInUse()intgetNumPhysicalOpen()java.lang.StringgetSchemaName()java.lang.StringgetTablePrefix()TenantgetTenant()voidinvalidate(ConnectionImpl conn)booleanisDBLogActive()booleanisDBLogAppendStackTraceActive()booleanisReadOnly()voidresetStats()Reset the statistics.voidreturnToPool(ConnectionImpl conn)voidsetDBLog(boolean active)voidsetDBLogAppendStackTrace(boolean active)longtotalGets()org.springframework.dao.DataAccessExceptiontranslateToDataAccessException(java.sql.SQLException e)Translates 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, 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:
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
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 SpringDataAccessExceptionexactly like it would have been done when using SpringJdbcTemplate.
-
getJDBCInterceptor
JDBCInterceptor getJDBCInterceptor()
-
-