Package com.sk89q.worldguard.util.sql
Class DataSourceConfig
java.lang.Object
com.sk89q.worldguard.util.sql.DataSourceConfig
Describes a data source.
-
Constructor Summary
ConstructorsConstructorDescriptionDataSourceConfig
(String dsn, String username, String password, String tablePrefix) Create a new instance. -
Method Summary
Modifier and TypeMethodDescriptionCreate a new connection.getDsn()
Get the DSN.Get the password.Get the table prefix.Get the username.Create a new instance with a new DSN.setPassword
(String password) Create a new instance with a new password.setTablePrefix
(String tablePrefix) Create a new instance with a new table prefix.setUsername
(String username) Create a new instance with a new username.
-
Constructor Details
-
DataSourceConfig
Create a new instance.- Parameters:
dsn
- the DSNusername
- the usernamepassword
- the passwordtablePrefix
- the table prefix
-
-
Method Details
-
getDsn
Get the DSN.- Returns:
- the DSN
-
getUsername
Get the username.- Returns:
- the username
-
getPassword
Get the password.- Returns:
- the password
-
getTablePrefix
Get the table prefix.- Returns:
- the table prefix
-
setDsn
Create a new instance with a new DSN.- Parameters:
dsn
- a new DSN string- Returns:
- a new instance
-
setUsername
Create a new instance with a new username.- Parameters:
username
- a new username- Returns:
- a new instance
-
setPassword
Create a new instance with a new password.- Parameters:
password
- a new password- Returns:
- a new instance
-
setTablePrefix
Create a new instance with a new table prefix.- Parameters:
tablePrefix
- the new table prefix- Returns:
- a new instance
-
getConnection
Create a new connection.- Returns:
- the new connection
- Throws:
SQLException
- raised if the connection cannot be instantiated
-