Class JDBConnection

java.lang.Object
org.attribyte.sql.pool.JDBConnection

public class JDBConnection extends Object
Immutable configuration for a database connection, including the connection string or DataSource, credentials, test SQL, and timeout settings.
  • Constructor Details

    • JDBConnection

      public JDBConnection(String name, String user, String password, String connectionString, long createTimeoutMillis, String testSQL, long testIntervalMillis, boolean debug)
      Creates a connection with a connection string.
      Parameters:
      name - The connection name.
      user - The database user.
      password - The database password.
      connectionString - The database connection string.
      createTimeoutMillis - The connection create timeout.
      testSQL - The test SQL.
      testIntervalMillis - The test frequency.
      debug - Should debug information be recorded?
    • JDBConnection

      public JDBConnection(String name, String user, String password, DataSource datasource, long createTimeoutMillis, String testSQL, long testIntervalMillis, boolean debug)
      Creates a connection with a DataSource.
      Parameters:
      name - The connection name.
      user - The database user.
      password - The database password.
      datasource - The DataSource.
      createTimeoutMillis - The connection create timeout.
      testSQL - The test SQL.
      testIntervalMillis - The test frequency.
      debug - Should debug information be recorded?
  • Method Details

    • validate

      public void validate() throws org.attribyte.api.InitializationException
      Verify that required parameters are set.
      Throws:
      org.attribyte.api.InitializationException - if required parameters are not set.
    • toString

      public String toString()
      Overrides:
      toString in class Object