Class DataSourceConfig

java.lang.Object
com.sk89q.worldguard.util.sql.DataSourceConfig

public class DataSourceConfig extends Object
Describes a data source.
  • Constructor Details

    • DataSourceConfig

      public DataSourceConfig(String dsn, String username, String password, String tablePrefix)
      Create a new instance.
      Parameters:
      dsn - the DSN
      username - the username
      password - the password
      tablePrefix - the table prefix
  • Method Details

    • getDsn

      public String getDsn()
      Get the DSN.
      Returns:
      the DSN
    • getUsername

      public String getUsername()
      Get the username.
      Returns:
      the username
    • getPassword

      public String getPassword()
      Get the password.
      Returns:
      the password
    • getTablePrefix

      public String getTablePrefix()
      Get the table prefix.
      Returns:
      the table prefix
    • setDsn

      public DataSourceConfig setDsn(String dsn)
      Create a new instance with a new DSN.
      Parameters:
      dsn - a new DSN string
      Returns:
      a new instance
    • setUsername

      public DataSourceConfig setUsername(String username)
      Create a new instance with a new username.
      Parameters:
      username - a new username
      Returns:
      a new instance
    • setPassword

      public DataSourceConfig setPassword(String password)
      Create a new instance with a new password.
      Parameters:
      password - a new password
      Returns:
      a new instance
    • setTablePrefix

      public DataSourceConfig setTablePrefix(String tablePrefix)
      Create a new instance with a new table prefix.
      Parameters:
      tablePrefix - the new table prefix
      Returns:
      a new instance
    • getConnection

      public Connection getConnection() throws SQLException
      Create a new connection.
      Returns:
      the new connection
      Throws:
      SQLException - raised if the connection cannot be instantiated