Package org.attribyte.sql.pool
Class JDBConnection.Initializer
java.lang.Object
org.attribyte.sql.pool.JDBConnection.Initializer
- Enclosing class:
JDBConnection
Initializes and creates an immutable connection configuration.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates an immutable connection from this initialization.setConnectionString(String connectionString) Sets the connection string.setCreateTimeoutMillis(long createTimeoutMillis) Sets a timeout use when creating new connections.setDatasource(DataSource datasource) Sets aDataSourceas the source of connections.setDebug(boolean debug) Sets debug mode.Sets the connection name.setPassword(String password) Sets the password.setTestIntervalMillis(long testIntervalMillis) Sets the connection test interval in milliseconds.setTestSQL(String testSQL) Sets the SQL statement used to test connections.Sets the user.
-
Constructor Details
-
Initializer
public Initializer()
-
-
Method Details
-
setName
Sets the connection name.- Parameters:
name- The connection name.- Returns:
- A self-reference.
-
setUser
Sets the user.- Parameters:
user- The user.- Returns:
- A self-reference.
-
setPassword
Sets the password.- Parameters:
password- The password.- Returns:
- A self-reference.
-
setConnectionString
Sets the connection string.- Parameters:
connectionString- The connection string.- Returns:
- A self-reference.
-
setTestSQL
Sets the SQL statement used to test connections.- Parameters:
testSQL- The test SQL.- Returns:
- A self-reference.
-
setTestIntervalMillis
Sets the connection test interval in milliseconds.- Parameters:
testIntervalMillis- The test interval in milliseconds.- Returns:
- A self-reference.
-
setCreateTimeoutMillis
Sets a timeout use when creating new connections. May be0.- Parameters:
createTimeoutMillis- The timeout in milliseconds.- Returns:
- A self-reference.
-
setDatasource
Sets aDataSourceas the source of connections.- Parameters:
datasource- The datasource.- Returns:
- A self-reference.
-
setDebug
Sets debug mode.When debug mode is
truethe call site of connection acquisitions is recorded and available for exceptions.- Parameters:
debug- The debug mode.- Returns:
- A self-reference.
-
createConnection
Creates an immutable connection from this initialization.- Returns:
- The connection.
-