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 Detail

      • 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
      • getTenant

        Tenant getTenant()
      • getConnection

        java.sql.Connection getConnection​(boolean transactionBound)
                                   throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • 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
      • 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 Spring DataAccessException exactly like it would have been done when using Spring JdbcTemplate.