de.stefan1200.util

## Class MySQLConnect

- java.lang.Object
- - de.stefan1200.util.MySQLConnect

-     public class MySQLConnect
      extends Object

  This MySQLConnect class loads the MySQL JDBC driver and holds the MySQL database connection.
  The author of the JTS3ServerMod is not responsible for any damage or data loss!
  E-Mail:
  info@stefan1200.de
  Homepage:
  http://www.stefan1200.de
  Author:
    Stefan Martens

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MySQLConnect(String mysqlHost, int mysqlPort, String mysqlDB, String mysqlUser, String mysqlPW, byte verifyServerCertificate, byte useSSL, byte requireSSL, byte useCompression)` Load the MySQL driver and set all connection parameters.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `void` | `connect()`
    `Connection` | `getConnection()`
    `PreparedStatement` | `getPreparedStatement(String sql)`
    `Statement` | `getStatement()`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MySQLConnect

          public MySQLConnect(String mysqlHost,
                              int mysqlPort,
                              String mysqlDB,
                              String mysqlUser,
                              String mysqlPW,
                              byte verifyServerCertificate,
                              byte useSSL,
                              byte requireSSL,
                              byte useCompression)
                       throws ClassNotFoundException

      Load the MySQL driver and set all connection parameters.
      Parameters:
        `mysqlHost` - MySQL hostname
        `mysqlPort` - MySQL port
        `mysqlDB` - MySQL database
        `mysqlUser` - MySQL username
        `mysqlPW` - MySQL password
        `verifyServerCertificate` - Should the driver verify the server's certificate? -1 = use default, 0 = no, 1 = yes
        `useSSL` - Use SSL when communicating with the server? -1 = use default, 0 = no, 1 = yes
        `requireSSL` - Require server support of SSL connection if useSSL = 1. -1 = use default, 0 = no, 1 = yes
        `useCompression` - Use zlib compression when communicating with the server? -1 = use default, 0 = no, 1 = yes
      Throws:
        `ClassNotFoundException` - If the MySQL driver was not found.

  - ### Method Detail

    - #### close

          public void close()

    - #### connect

          public void connect()
                       throws SQLException

      Throws:
        `SQLException`

    - #### getConnection

          public Connection getConnection()

    - #### getPreparedStatement

          public PreparedStatement getPreparedStatement(String sql)
                                                 throws SQLException

      Throws:
        `SQLException`

    - #### getStatement

          public Statement getStatement()
                                 throws SQLException

      Throws:
        `SQLException`