Class CayenneDataSource.Builder
java.lang.Object
org.apache.cayenne.datasource.CayenneDataSource.Builder
- Enclosing class:
CayenneDataSource
- Since:
- 5.0
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a DataSource that is pooling ifpool(int, int)was called, and non-pooling otherwise.Sets an already instantiated JDBC driver, bypassing driver discovery and class loading.driverClass(String driverClassName) Sets a class name of the JDBC driver.maxQueueWaitTime(long maxQueueWaitTime) Sets a maximum time in milliseconds a connection request may wait for a free connection in the pool.pool(int minConnections, int maxConnections) Turns the built DataSource into a connection pool with the given connection count bounds.validationQuery(String validationQuery) Sets a SQL query used by the pool to check connection health.
-
Method Details
-
userName
-
password
-
driverClass
Sets a class name of the JDBC driver. This is optional and is only used in special circumstances. Normally, JDBC-compliant drivers are discovered automatically, and resolved based on the URL. -
driver
Sets an already instantiated JDBC driver, bypassing driver discovery and class loading. This is only needed when the driver can not be loaded by Cayenne's own ClassLoader, e.g. by tools that load JDBC drivers supplied by the user.- Since:
- 5.0
-
pool
Turns the built DataSource into a connection pool with the given connection count bounds. -
maxQueueWaitTime
Sets a maximum time in milliseconds a connection request may wait for a free connection in the pool. Ignored unlesspool(int, int)is also called. -
validationQuery
Sets a SQL query used by the pool to check connection health. Ignored unlesspool(int, int)is also called. -
build
Builds a DataSource that is pooling ifpool(int, int)was called, and non-pooling otherwise. A pooling DataSource isAutoCloseableand must be explicitly closed by the caller when no longer in use.
-