Class ConnectionProfileSetup

    • Field Detail

      • PROP_VENDOR

        public static final java.lang.String PROP_VENDOR
        Predefined property name: vendor (e.g. "Derby").
        See Also:
        Constant Field Values
      • PROP_VERSION

        public static final java.lang.String PROP_VERSION
        Predefined property name: version of driver (e.g. "10.2").
        See Also:
        Constant Field Values
      • PROP_DRIVER_DEFINITION_ID

        public static final java.lang.String PROP_DRIVER_DEFINITION_ID
        Predefined property name: driver definition ID in Eclipse DTP connection profiles (e.g. "DriverDefn.org.eclipse.birt.report.data.oda.jdbc.dbprofile.sampledb.driverTemplate.BIRT SampleDb Derby Embedded Driver").
        See Also:
        Constant Field Values
      • PROP_CLASSPATH

        public static final java.lang.String PROP_CLASSPATH
        Predefined property name: classpath as list of Jar's (e.g. "C:\Eclipse\64\j2ee-luna\plugins\org.apache.derby.core_10.5.1.1_v201405191524\derby.jar"), separated by comma's. Duplicate comma's mean a single one!
        See Also:
        Constant Field Values
      • PROP_DRIVER_CLASS

        public static final java.lang.String PROP_DRIVER_CLASS
        Predefined property name: JDBC driver class name, (e.g. "org.apache.derby.jdbc.EmbeddedDriver").
        See Also:
        Constant Field Values
      • PROP_DATABASE_NAME

        public static final java.lang.String PROP_DATABASE_NAME
        Predefined property name: database name (e.g. "BirtSample").
        See Also:
        Constant Field Values
      • PROP_URL

        public static final java.lang.String PROP_URL
        Predefined property name: URL to database (e.g. "jdbc:derby:C:\iizi\runtime\.metadata\.plugins\org.eclipse.birt.report.data.oda.jdbc.dbprofile.sampledb/db/BirtSample").
        See Also:
        Constant Field Values
      • PROP_USERNAME

        public static final java.lang.String PROP_USERNAME
        Predefined property name: user name.
        See Also:
        Constant Field Values
      • PROP_PASSWORD

        public static final java.lang.String PROP_PASSWORD
        Predefined property name: password (this property is not a StringProp but a PasswordProp!)
        See Also:
        Constant Field Values
      • PROP_POOL_SIZE

        public static final java.lang.String PROP_POOL_SIZE
        Predefined property name: pool size (this property is not a StringProp but a IntProp!)
        See Also:
        Constant Field Values
      • PROP_POOL_TIMEOUT

        public static final java.lang.String PROP_POOL_TIMEOUT
        Predefined property name: pool timeout (this property is not a StringProp but a IntProp!)
        See Also:
        Constant Field Values
      • PROP_VALID_TIMEOUT

        public static final java.lang.String PROP_VALID_TIMEOUT
        Predefined property name: connection valid timeout (this property is not a StringProp but a IntProp!)
        See Also:
        Constant Field Values
      • DEFAULT_POOL_SIZE

        public static final int DEFAULT_POOL_SIZE
        The default pool size: 100.
        See Also:
        Constant Field Values
      • DEFAULT_POOL_TIMEOUT

        public static final int DEFAULT_POOL_TIMEOUT
        The default pool timeout in milliseconds: 10,000 ms (10 seconds).
        See Also:
        Constant Field Values
      • DEFAULT_VALID_TIMEOUT

        public static final int DEFAULT_VALID_TIMEOUT
        The default connection validity timeout in milliseconds: 1000 ms (1 seconds).
        See Also:
        Constant Field Values
      • PROP_LIST

        public static final java.lang.String[] PROP_LIST
        Names that are placed as StringProp's instead of placed into the Properties StringMapProp.
    • Constructor Detail

      • ConnectionProfileSetup

        public ConnectionProfileSetup()
        Constructs the connection profile setup container without name.
      • ConnectionProfileSetup

        public ConnectionProfileSetup​(Atom name)
        Constructs the connection profile setup container with specified name.
        Parameters:
        name - The name.
    • Method Detail

      • onPropDispose

        protected void onPropDispose()
        Disposes of the connection pool if allocated without closing current connections.
        Overrides:
        onPropDispose in class PropCnr
      • getName

        public java.lang.String getName()
        Gets the name of the profile.
        Returns:
        The profile name, or "<undefined>" if not defined.
      • setName

        public boolean setName​(java.lang.String name)
        Sets the name of the profile.
        Parameters:
        name - The name of the profile.
        Returns:
        true when this property container has been changed, false otherwise (or for error).
      • setFromEclipseBase

        public void setFromEclipseBase​(java.util.Properties props)
        Stores the information from Eclipse connection profile base Properties.
        Parameters:
        props - The Properties.
      • createDriverProperties

        public java.util.Properties createDriverProperties()
        Creates the Driver specific Properties.
        Returns:
        A new Properties instance with at least "user" and "password" set.
      • isJDBCDriverEqual

        public boolean isJDBCDriverEqual​(ConnectionProfileSetup setup)
        Verification if two connection profiles are equal in terms of the JDBC Driver information. The Properties are checked for equality, excluding the connection profile name and other settings that are not used in the JDBC Driver construction.
        Parameters:
        setup - Another connection profile setup to check for "equality".
        Returns:
        true if it would result in the same JDBC Driver setup, false otherwise.
      • getConnectionPool

        public IDBConnectionPool getConnectionPool()
                                            throws ActionActorException
        Gets the connection pool to retrieve a new connection. This is called when the DB TXP node is created. Normally the pool should have been created, otherwise log a warning.
        Returns:
        The connection pool.
        Throws:
        ActionActorException - If there is a problem such as connection profiles disposed of or failure to initialize the pool.
      • getTransactionIsolationLevel

        public int getTransactionIsolationLevel()
        Gets the transaction isolation level.
        Returns:
        The level is one of the following Connection constants: Connection.TRANSACTION_READ_UNCOMMITTED, Connection.TRANSACTION_READ_COMMITTED (default if value is undefined), Connection.TRANSACTION_REPEATABLE_READ, or Connection.TRANSACTION_SERIALIZABLE.
      • getAutoCommit

        public boolean getAutoCommit()
        Gets the auto-commit mode.
        Returns:
        true for auto-commit mode (default), false for manual commit.
      • getConnection

        public java.sql.Connection getConnection()
                                          throws java.sql.SQLException
        Gets a new connection from the pool.
        Returns:
        The connection, initialized with the auto-commit mode of the connection profile and transaction isolation level (if JDBC driver supports it).
        Throws:
        java.sql.SQLException - If the pool is closed or found a connection that was closed or invalid and needed to recreate a connection because the pool was exhausted.