public class DBConfig
extends java.lang.Object
implements java.io.Serializable
The configuration can be easily done via the visual AdminTool provided in SmartFoxServer 2X, however you might want to create these objects manually via code when your application requires to connect to multiple databases.
SFSDBManager
,
Serialized FormModifier and Type | Field and Description |
---|---|
boolean |
active
Toggles the DBManager
|
int |
blockTime
The amount of time to block if the BLOCK option is chosen for the exhaustedPoolAction setting
|
java.lang.String |
connectionString
The connection string to the database, according to the JDBC standard notation.
|
java.lang.String |
driverName
Fully qualified name of the database driver, for example com.mysql.jdbc.Driver
|
java.lang.String |
exhaustedPoolAction
The action that should be executed when the connection pool is exhausted.
|
int |
maxActiveConnections
The maximum number of active connections in the connection pool
|
int |
maxIdleConnections
The maximum number of idle connections in the connection pool
|
java.lang.String |
password
The password for accessing the database
|
static java.lang.String |
POOL_ACTION_BLOCK |
static java.lang.String |
POOL_ACTION_FAIL |
static java.lang.String |
POOL_ACTION_GROW |
java.lang.String |
testSql
A test SQL expression that will be executed at startup to verify the integrity of the setup and connection
It is recommended to use very simple SQL code such as SELECT count(*) FROM users or a similar quick SQL query.
|
java.lang.String |
userName
The user name for accessing the database
|
Constructor and Description |
---|
DBConfig() |
public static final java.lang.String POOL_ACTION_FAIL
public static final java.lang.String POOL_ACTION_BLOCK
public static final java.lang.String POOL_ACTION_GROW
public boolean active
public java.lang.String driverName
public java.lang.String connectionString
You can read more about this here: http://download.oracle.com/javase/tutorial/jdbc/basics/connecting.html
public java.lang.String userName
public java.lang.String password
public java.lang.String testSql
It is recommended to use very simple SQL code such as SELECT count(*) FROM users or a similar quick SQL query.
public int maxActiveConnections
public int maxIdleConnections
public java.lang.String exhaustedPoolAction
public int blockTime