public class DatabaseConnectionFactory
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.sql.Connection |
createConnection(java.lang.String driver,
java.lang.String address,
java.lang.String username,
java.lang.String password)
Instantiates and returns a new java.sql.Connection object with the given connection
parameters.
|
static DatabaseConnection |
createDatabaseConnection(java.lang.String driver,
java.lang.String address)
Instantiates and returns a new DatabaseConnection object with the given connection
parameters.
|
static DatabaseConnection |
createDatabaseConnection(java.lang.String driver,
java.lang.String address,
java.lang.String username,
java.lang.String password)
Instantiates and returns a new DatabaseConnection object with the given connection
parameters.
|
static void |
initializeDriver(java.lang.String driver)
Initializes the specified JDBC driver.
|
public static DatabaseConnection createDatabaseConnection(java.lang.String driver, java.lang.String address, java.lang.String username, java.lang.String password) throws java.sql.SQLException
driver
- The JDBC driver class (as a string) to use to create the connection with.address
- The server address to connect to.username
- The username to connect with.password
- The password to connect with.java.sql.SQLException
public static DatabaseConnection createDatabaseConnection(java.lang.String driver, java.lang.String address) throws java.sql.SQLException
driver
- The JDBC driver class (as a string) to use to create the connection with.address
- The server address to connect to.java.sql.SQLException
public static java.sql.Connection createConnection(java.lang.String driver, java.lang.String address, java.lang.String username, java.lang.String password) throws java.sql.SQLException
driver
- The JDBC driver class (as a string) to use to create the connection with.address
- The server address to connect to.username
- The username to connect with.password
- The password to connect with.java.sql.SQLException
public static void initializeDriver(java.lang.String driver) throws java.lang.Exception
driver
- The JDBC driver class (as a string) to initialize.java.lang.Exception