Package org.javalite.activeweb
Class ConnectionBuilder
java.lang.Object
org.javalite.activeweb.ConnectionBuilder
Supports DSL for specifying connection parameters for various environments and modes.
This class is not used directly.
- Author:
- Igor Polevoy
-
Method Summary
Modifier and TypeMethodDescriptionvoid
dataSource(DataSource dataSource)
Sets aDataSource
to be used by this configuration.Name of a database.void
Configure standard JDBC parameters for opening a connection.void
jdbc(String driver, String url, Properties props)
Configure expanded JDBC parameters for opening a connection if neededvoid
Provide a name of a JNDI datasource configured for runtime.testing()
Marks this connection to be used for testing.
-
Method Details
-
jndi
Provide a name of a JNDI datasource configured for runtime.- Parameters:
jndi
- name of a JNDI datasource
-
jdbc
Configure standard JDBC parameters for opening a connection.- Parameters:
driver
- class name of driverurl
- JDBC URLuser
- user namepassword
- password
-
jdbc
Configure expanded JDBC parameters for opening a connection if needed- Parameters:
driver
- class name of driverurl
- JDBC URLprops
- properties with additional parameters a driver can take.
-
db
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
Marks this connection to be used for testing. When you use any of the testing classes, such asDBSpec, DBControllerSpec, DBIntegrationSpec, AppIntegrationSpec
fromactiveweb-testing
module, they all will use a connection that is marked by this method.- Returns:
- self
-
dataSource
Sets aDataSource
to be used by this configuration.- Parameters:
dataSource
- instance of a datasource
-