Class ConnectionBuilder

java.lang.Object
org.javalite.activeweb.ConnectionBuilder

public class ConnectionBuilder extends Object
Supports DSL for specifying connection parameters for various environments and modes. This class is not used directly.
Author:
Igor Polevoy
  • Method Details

    • jndi

      public void jndi(String jndi)
      Provide a name of a JNDI datasource configured for runtime.
      Parameters:
      jndi - name of a JNDI datasource
    • jdbc

      public void jdbc(String driver, String url, String user, String password)
      Configure standard JDBC parameters for opening a connection.
      Parameters:
      driver - class name of driver
      url - JDBC URL
      user - user name
      password - password
    • jdbc

      public void jdbc(String driver, String url, Properties props)
      Configure expanded JDBC parameters for opening a connection if needed
      Parameters:
      driver - class name of driver
      url - JDBC URL
      props - properties with additional parameters a driver can take.
    • db

      public ConnectionBuilder db(String dbName)
      Name of a database. If this method is not called, the name od database is presumed "default".
      Parameters:
      dbName - name od database for ActiveJDBC models.
      Returns:
      self
    • testing

      public ConnectionBuilder testing()
      Marks this connection to be used for testing. When you use any of the testing classes, such as DBSpec, DBControllerSpec, DBIntegrationSpec, AppIntegrationSpec from activeweb-testing module, they all will use a connection that is marked by this method.
      Returns:
      self
    • dataSource

      public void dataSource(DataSource dataSource)
      Sets a DataSource to be used by this configuration.
      Parameters:
      dataSource - instance of a datasource