de.cesr.sesamgim.util
Class GMySqlService

java.lang.Object
  extended by de.cesr.sesamgim.util.GMySqlService

public class GMySqlService
extends Object


Field Summary
protected static GMySqlService instance
          The instance of this class
 
Method Summary
 ResultSet connect(String sql)
          Execute the given SQL statement and return the according ResultSet
static void disconnect()
          Disconnect the current mySQL connection
protected static Connection getConnection()
          Returns the current connection.
static GMySqlService getInstance()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

protected static GMySqlService instance
The instance of this class

Method Detail

getInstance

public static GMySqlService getInstance()
Returns:
an instance of this class

getConnection

protected static Connection getConnection()
                                   throws InstantiationException,
                                          IllegalAccessException,
                                          ClassNotFoundException,
                                          SQLException
Returns the current connection. If not existing, it tries to establish a JDBC Connection to the MySQL database given the settings provided to the constructor.

Throws:
InstantiationException
IllegalAccessException
ClassNotFoundException
SQLException

connect

public ResultSet connect(String sql)
                  throws SQLException,
                         InstantiationException,
                         IllegalAccessException,
                         ClassNotFoundException
Execute the given SQL statement and return the according ResultSet

Parameters:
sql - the statement to query
Returns:
the ResultSet
Throws:
SQLException
InstantiationException
IllegalAccessException
ClassNotFoundException

disconnect

public static void disconnect()
Disconnect the current mySQL connection