|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mirth.connect.server.userutil.DatabaseConnection
public class DatabaseConnection
Provides the ability to run SQL queries again the database connection object instantiated using DatabaseConnectionFactory.
Constructor Summary | |
---|---|
DatabaseConnection(java.lang.String address)
Instantiates a new database connection with the given server address. |
|
DatabaseConnection(java.lang.String address,
java.util.Properties info)
Instantiates a new database connection with the given server address and connection arguments. |
Method Summary | |
---|---|
void |
close()
Closes the database connection. |
void |
commit()
Makes all changes made since the previous commit/rollback permanent and releases any database locks currently held by this DatabaseConnection object. |
javax.sql.rowset.CachedRowSet |
executeCachedQuery(java.lang.String expression)
Executes a query on the database and returns a CachedRowSet. |
javax.sql.rowset.CachedRowSet |
executeCachedQuery(java.lang.String expression,
java.util.List<java.lang.Object> parameters)
Executes a prepared query on the database and returns a CachedRowSet. |
int |
executeUpdate(java.lang.String expression)
Executes an INSERT/UPDATE on the database and returns the row count. |
int |
executeUpdate(java.lang.String expression,
java.util.List<java.lang.Object> parameters)
Executes a prepared INSERT/UPDATE statement on the database and returns the row count. |
javax.sql.rowset.CachedRowSet |
executeUpdateAndGetGeneratedKeys(java.lang.String expression)
Executes an INSERT/UPDATE statement on the database and returns a CachedRowSet containing any generated keys. |
javax.sql.rowset.CachedRowSet |
executeUpdateAndGetGeneratedKeys(java.lang.String expression,
java.util.List<java.lang.Object> parameters)
Executes a prepared INSERT/UPDATE statement on the database and returns a CachedRowSet containing any generated keys. |
java.lang.String |
getAddress()
Returns the server address. |
java.sql.Connection |
getConnection()
Returns the database connection (java.sql.Connection) this class is using. |
void |
rollback()
Undoes all changes made in the current transaction and releases any database locks currently held by this Connection object. |
void |
setAutoCommit(boolean autoCommit)
Sets this connection's auto-commit mode to the given state. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DatabaseConnection(java.lang.String address) throws java.sql.SQLException
address
- The server address to connect to.
java.sql.SQLException
public DatabaseConnection(java.lang.String address, java.util.Properties info) throws java.sql.SQLException
address
- The server address to connect to.info
- A Properties object containing all applicable connection arguments.
java.sql.SQLException
Method Detail |
---|
public java.lang.String getAddress()
public javax.sql.rowset.CachedRowSet executeCachedQuery(java.lang.String expression) throws java.sql.SQLException
expression
- The query expression to be executed.
java.sql.SQLException
public int executeUpdate(java.lang.String expression) throws java.sql.SQLException
expression
- The statement to be executed.
java.sql.SQLException
public int executeUpdate(java.lang.String expression, java.util.List<java.lang.Object> parameters) throws java.sql.SQLException
expression
- The prepared statement to be executed.parameters
- The parameters for the prepared statement.
java.sql.SQLException
public javax.sql.rowset.CachedRowSet executeCachedQuery(java.lang.String expression, java.util.List<java.lang.Object> parameters) throws java.sql.SQLException
expression
- The prepared statement to be executed.parameters
- The parameters for the prepared statement.
java.sql.SQLException
public void close()
public void setAutoCommit(boolean autoCommit) throws java.sql.SQLException
autoCommit
- The value (true or false) to set the connection's auto-commit mode to.
java.sql.SQLException
public void rollback() throws java.sql.SQLException
java.sql.SQLException
public void commit() throws java.sql.SQLException
java.sql.SQLException
public javax.sql.rowset.CachedRowSet executeUpdateAndGetGeneratedKeys(java.lang.String expression) throws java.sql.SQLException
expression
- The statement to be executed.
java.sql.SQLException
public javax.sql.rowset.CachedRowSet executeUpdateAndGetGeneratedKeys(java.lang.String expression, java.util.List<java.lang.Object> parameters) throws java.sql.SQLException
expression
- The prepared statement to be executed.parameters
- The parameters for the prepared statement.
java.sql.SQLException
public java.sql.Connection getConnection()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |