org.radrails.db.core.mysql
Class MySQLDatabaseConnection

java.lang.Object
  extended byorg.radrails.db.core.DatabaseConnection
      extended byorg.radrails.db.core.mysql.MySQLDatabaseConnection

public class MySQLDatabaseConnection
extends DatabaseConnection

Verifies a connection can be made with the database.

Version:
0.2.0
Author:
mbaumbach

Field Summary
static java.lang.String JDBC_MYSQL_URL
           
static java.lang.String MYSQL_DEFAULT_PORT
           
static java.lang.String MYSQL_LOCALHOST
           
 
Constructor Summary
MySQLDatabaseConnection()
           
 
Method Summary
 java.sql.Connection connect(DatabaseDescriptor desc)
          Gets a connection to a database.
 java.lang.String getDefaultPort()
          Gets the default port for the specified database connection.
 
Methods inherited from class org.radrails.db.core.DatabaseConnection
testConnect
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MYSQL_LOCALHOST

public static final java.lang.String MYSQL_LOCALHOST
See Also:
Constant Field Values

MYSQL_DEFAULT_PORT

public static final java.lang.String MYSQL_DEFAULT_PORT
See Also:
Constant Field Values

JDBC_MYSQL_URL

public static final java.lang.String JDBC_MYSQL_URL
See Also:
Constant Field Values
Constructor Detail

MySQLDatabaseConnection

public MySQLDatabaseConnection()
Method Detail

getDefaultPort

public java.lang.String getDefaultPort()
Description copied from class: DatabaseConnection
Gets the default port for the specified database connection.

Specified by:
getDefaultPort in class DatabaseConnection
Returns:
The default port, or null if no default is known.
See Also:
DatabaseConnection.getDefaultPort()

connect

public java.sql.Connection connect(DatabaseDescriptor desc)
                            throws java.sql.SQLException,
                                   java.lang.InstantiationException,
                                   java.lang.IllegalAccessException
Description copied from class: DatabaseConnection
Gets a connection to a database.

Specified by:
connect in class DatabaseConnection
Parameters:
desc - The DatabaseDescriptor to obtain information from.
Returns:
A java.sql.Connection to the database.
Throws:
java.sql.SQLException - If an error occurs while connecting to the database
java.lang.IllegalAccessException - If an error occurs while getting the driver class.
java.lang.InstantiationException - If the driver class cannot be instantiated.
See Also:
DatabaseConnection.connect(org.radrails.db.core.DatabaseDescriptor)