|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.avaje.ebean.config.DataSourceConfig
public class DataSourceConfig
Used to config a DataSource when using the internal Ebean DataSource implementation.
If a DataSource instance is already defined via ServerConfig.setDataSource(javax.sql.DataSource)
or defined as JNDI dataSource via ServerConfig.setDataSourceJndiName(String)
then those will used and not this DataSourceConfig.
Constructor Summary | |
---|---|
DataSourceConfig()
|
Method Summary | |
---|---|
int |
getCstmtCacheSize()
Return the size of the CallableStatement cache (per connection). |
String |
getDriver()
Return the database driver. |
String |
getHeartbeatSql()
Return a SQL statement used to test the database is accessible. |
int |
getLeakTimeMinutes()
Return the time in minutes after which a connection could be considered to have leaked. |
int |
getMaxConnections()
Return the maximum number of connections the pool can reach. |
int |
getMaxInactiveTimeSecs()
Return the time in seconds a connection can be idle after which it can be trimmed from the pool. |
int |
getMaxStackTraceSize()
Return the max size for reporting stack traces on busy connections. |
int |
getMinConnections()
Return the minimum number of connections the pool should maintain. |
String |
getPassword()
Return the database password. |
String |
getPoolListener()
Return the pool listener. |
int |
getPstmtCacheSize()
Return the size of the PreparedStatement cache (per connection). |
String |
getUrl()
Return the connection URL. |
String |
getUsername()
Return the database username. |
int |
getWaitTimeoutMillis()
Return the time in millis to wait for a connection before timing out once the pool has reached its maximum size. |
boolean |
isCaptureStackTrace()
Return true if a stack trace should be captured when obtaining a connection from the pool. |
boolean |
isOffline()
Return true if the DataSource should be left offline. |
void |
loadSettings(String serverName)
Load the settings from ebean.properties. |
void |
setCaptureStackTrace(boolean captureStackTrace)
Set to true if a stack trace should be captured when obtaining a connection from the pool. |
void |
setCstmtCacheSize(int cstmtCacheSize)
Set the size of the CallableStatement cache (per connection). |
void |
setDriver(String driver)
Set the database driver. |
void |
setHeartbeatSql(String heartbeatSql)
Set a SQL statement used to test the database is accessible. |
void |
setLeakTimeMinutes(int leakTimeMinutes)
Set the time in minutes after which a connection could be considered to have leaked. |
void |
setMaxConnections(int maxConnections)
Set the maximum number of connections the pool can reach. |
void |
setMaxInactiveTimeSecs(int maxInactiveTimeSecs)
Set the time in seconds a connection can be idle after which it can be trimmed from the pool. |
void |
setMaxStackTraceSize(int maxStackTraceSize)
Set the max size for reporting stack traces on busy connections. |
void |
setMinConnections(int minConnections)
Set the minimum number of connections the pool should maintain. |
void |
setOffline(boolean offline)
Set to true if the DataSource should be left offline. |
void |
setPassword(String password)
Set the database password. |
void |
setPoolListener(String poolListener)
Set a pool listener. |
void |
setPstmtCacheSize(int pstmtCacheSize)
Set the size of the PreparedStatement cache (per connection). |
void |
setUrl(String url)
Set the connection URL. |
void |
setUsername(String username)
Set the database username. |
void |
setWaitTimeoutMillis(int waitTimeoutMillis)
Set the time in millis to wait for a connection before timing out once the pool has reached its maximum size. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataSourceConfig()
Method Detail |
---|
public String getUrl()
public void setUrl(String url)
public String getUsername()
public void setUsername(String username)
public String getPassword()
public void setPassword(String password)
public String getDriver()
public void setDriver(String driver)
public int getMinConnections()
public void setMinConnections(int minConnections)
public int getMaxConnections()
public void setMaxConnections(int maxConnections)
public String getHeartbeatSql()
Note that if this is not set then it can get defaulted from the DatabasePlatform.
public void setHeartbeatSql(String heartbeatSql)
Note that if this is not set then it can get defaulted from the DatabasePlatform.
public boolean isCaptureStackTrace()
This can be used to diagnose a suspected connection pool leak.
Obviously this has a performance overhead.
public void setCaptureStackTrace(boolean captureStackTrace)
This can be used to diagnose a suspected connection pool leak.
Obviously this has a performance overhead.
public int getMaxStackTraceSize()
public void setMaxStackTraceSize(int maxStackTraceSize)
public int getLeakTimeMinutes()
public void setLeakTimeMinutes(int leakTimeMinutes)
public int getPstmtCacheSize()
public void setPstmtCacheSize(int pstmtCacheSize)
public int getCstmtCacheSize()
public void setCstmtCacheSize(int cstmtCacheSize)
public int getWaitTimeoutMillis()
public void setWaitTimeoutMillis(int waitTimeoutMillis)
public int getMaxInactiveTimeSecs()
This is so that the pool after a busy period can trend over time back towards the minimum connections.
public void setMaxInactiveTimeSecs(int maxInactiveTimeSecs)
This is so that the pool after a busy period can trend over time back towards the minimum connections.
public String getPoolListener()
public void setPoolListener(String poolListener)
public boolean isOffline()
This is to support DDL generation etc without having a real database.
public void setOffline(boolean offline)
This is to support DDL generation etc without having a real database.
Note that you MUST specify the database platform name (oracle, postgres,
h2, mysql etc) using ServerConfig.setDatabasePlatformName(String)
when you do this.
public void loadSettings(String serverName)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |