Class ConnectionProfileSetup

java.lang.Object
com.iizix.prop.GProp<GProp<?>[]>
com.iizix.prop.PropCnr
com.iizix.db.prop.ConnectionProfileSetup
All Implemented Interfaces:
EventListener, IGProp<GProp<?>[]>, IPropCnr, Cloneable
Direct Known Subclasses:
EditorConnectionProfileSetup

public class ConnectionProfileSetup extends PropCnr
A single connection profile setup that is used to establish a JDBC connection.
Author:
Christopher Mindus
  • Field Details Link icon

    • PROP_VENDOR Link icon

      public static final String PROP_VENDOR
      Predefined property name: vendor (e.g. "Derby").
      See Also:
    • PROP_VERSION Link icon

      public static final String PROP_VERSION
      Predefined property name: version of driver (e.g. "10.2").
      See Also:
    • PROP_DRIVER_DEFINITION_ID Link icon

      public static final 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:
    • PROP_CLASSPATH Link icon

      public static final String PROP_CLASSPATH
      Predefined property name: classpath as list of Jar's (e.g. "C:\Eclipse\64\eclipsename\plugins\org.apache.derby.core_v.er.si.on_vDATEtime\derby.jar"), separated by comma's. Duplicate comma's mean a single one!
      See Also:
    • PROP_DRIVER_CLASS Link icon

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

      public static final String PROP_DATABASE_NAME
      Predefined property name: database name (e.g. "BirtSample").
      See Also:
    • PROP_URL Link icon

      public static final 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:
    • PROP_USERNAME Link icon

      public static final String PROP_USERNAME
      Predefined property name: user name.
      See Also:
    • PROP_PASSWORD Link icon

      public static final String PROP_PASSWORD
      Predefined property name: password (this property is not a StringProp but a PasswordProp!)
      See Also:
    • PROP_POOL_SIZE Link icon

      public static final String PROP_POOL_SIZE
      Predefined property name: pool size (this property is not a StringProp but a IntProp!)
      See Also:
    • PROP_POOL_TIMEOUT Link icon

      public static final String PROP_POOL_TIMEOUT
      Predefined property name: pool timeout (this property is not a StringProp but a IntProp!)
      See Also:
    • PROP_VALID_TIMEOUT Link icon

      public static final String PROP_VALID_TIMEOUT
      Predefined property name: connection valid timeout (this property is not a StringProp but a IntProp!)
      See Also:
    • DEFAULT_POOL_SIZE Link icon

      public static final int DEFAULT_POOL_SIZE
      The default pool size: 100.
      See Also:
    • DEFAULT_POOL_TIMEOUT Link icon

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

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

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

    • ConnectionProfileSetup Link icon

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

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

    • clone Link icon

      public ConnectionProfileSetup clone()
      Clones the instance.
      Overrides:
      clone in class PropCnr
    • onPropDispose Link icon

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

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

      public boolean setName(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 Link icon

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

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

      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 Link icon

      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 Link icon

      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 Link icon

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

      public Connection getConnection() throws 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:
      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.