public class MySQLConnector
extends java.lang.Object
| Modifier and Type | Field and Description | 
|---|---|
| static int | connectCounterThe connect counter. | 
| private java.lang.String | databaseThe database. | 
| private java.sql.Connection | dBconnectionThe d bconnection. | 
| static boolean | debugFlagThe debug flag. | 
| private java.lang.String | driverThe driver. | 
| private static boolean | FAILThe Constant FAIL. | 
| private java.lang.String | hostThe host. | 
| protected org.apache.log4j.Logger | loggerThe logger. | 
| private java.lang.String | passwordThe password. | 
| private static java.lang.String | PROP_FILEName of the properties file which must exist on the classpath. | 
| private java.sql.ResultSet | resultSetThe result set. | 
| private java.lang.String | sqlStrThe sql str. | 
| private java.sql.Statement | statementThe statement. | 
| private static boolean | SUCCESSThe Constant SUCCESS. | 
| static java.lang.String | TABLE_INFO_NAMEThe Constant TABLE_INFO_NAME. | 
| private java.lang.String | userThe user. | 
| Constructor and Description | 
|---|
| MySQLConnector()Instantiates a new my sql connector. | 
| MySQLConnector(java.lang.String host,
              java.lang.String user,
              java.lang.String password,
              java.lang.String database,
              java.lang.String driver)Instantiates a new my sql connector. | 
| Modifier and Type | Method and Description | 
|---|---|
| java.sql.Connection | connect()Connect. | 
| java.sql.Connection | connect(java.lang.String user,
       java.lang.String password)Connect. | 
| void | disconnect()Disconnect. | 
| java.sql.Connection | getConnection()Gets the connection. | 
| java.sql.ResultSet | runRawSQL(java.lang.String stmt)Run an unchecked sql command. | 
| private boolean | SQLError(java.lang.Exception e,
        java.lang.String sqlStr)SQL error. | 
| void | terminate()Terminate. | 
private static final java.lang.String PROP_FILE
public static final java.lang.String TABLE_INFO_NAME
private java.lang.String host
private java.lang.String database
private java.lang.String driver
private java.lang.String user
private java.lang.String password
private java.sql.Connection dBconnection
private java.sql.Statement statement
private java.sql.ResultSet resultSet
private java.lang.String sqlStr
public static boolean debugFlag
private static final boolean SUCCESS
private static final boolean FAIL
public static int connectCounter
protected org.apache.log4j.Logger logger
public MySQLConnector()
public MySQLConnector(java.lang.String host,
              java.lang.String user,
              java.lang.String password,
              java.lang.String database,
              java.lang.String driver)
host - the hostuser - the userpassword - the passworddatabase - the databasedriver - the driverprivate boolean SQLError(java.lang.Exception e,
               java.lang.String sqlStr)
e - the esqlStr - the sql strpublic java.sql.Connection connect()
public java.sql.Connection connect(java.lang.String user,
                          java.lang.String password)
user - the userpassword - the passwordpublic void disconnect()
public java.sql.Connection getConnection()
public void terminate()
public java.sql.ResultSet runRawSQL(java.lang.String stmt)
                             throws java.lang.Exception
stmt - the stmtjava.lang.Exception - the exception