public class DatabaseConnectionFactory extends Object
Constructor and Description |
---|
DatabaseConnectionFactory(com.mirth.connect.server.util.javascript.MirthContextFactory contextFactory) |
Modifier and Type | Method and Description |
---|---|
Connection |
createConnection(String driver,
String address,
String username,
String password)
Instantiates and returns a new java.sql.Connection object with the given connection
parameters.
|
DatabaseConnection |
createDatabaseConnection(String driver,
String address)
Instantiates and returns a new DatabaseConnection object with the given connection
parameters.
|
DatabaseConnection |
createDatabaseConnection(String driver,
String address,
String username,
String password)
Instantiates and returns a new DatabaseConnection object with the given connection
parameters.
|
void |
initializeDriver(String driver)
Initializes the specified JDBC driver.
|
public DatabaseConnectionFactory(com.mirth.connect.server.util.javascript.MirthContextFactory contextFactory)
public DatabaseConnection createDatabaseConnection(String driver, String address, String username, String password) throws 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.SQLException
- If a database access error occurs.public DatabaseConnection createDatabaseConnection(String driver, String address) throws SQLException
driver
- The JDBC driver class (as a string) to use to create the connection with.address
- The server address to connect to.SQLException
- If a database access error occurs.public Connection createConnection(String driver, String address, String username, String password) throws 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.SQLException
- If a database access error occurs.public void initializeDriver(String driver) throws Exception
driver
- The JDBC driver class (as a string) to initialize.Exception
- If the driver could not be initialized.