public class DBShortcut extends java.lang.Object implements FixedLoggers
Modifier and Type | Field and Description |
---|---|
int |
ANY
Other sql statment types.
|
int |
QUERY
Sql statment type: Query.
|
int |
UPDATE
Sql statement type: update.
|
APPLOGGER, CRONTASKLOGGER, CRONTASKMGRLOGGER, CRONTASKMGRSQLLOGGER, DBCONNECTIONLOGGER, DDLOGGER, DMLOGGER, EVENTLOGGER, EXCEPTIONLOGGER, MAILLOGGER, MAXIMOLOGGER, MTLOGGER, NULLMBOPOINTER, SECURITY, SENDFAILEDLOGGER, SERVICELOGGER, SQLLOGGER
appenderPrefix, LOGGERNAME_APP, LOGGERNAME_CRONTASK, LOGGERNAME_CRONTASKMGR, LOGGERNAME_DBCONNECTION, LOGGERNAME_DD, LOGGERNAME_DM, LOGGERNAME_DMPREVIEW, LOGGERNAME_EVENT, LOGGERNAME_EXCEPTION, LOGGERNAME_MAIL, LOGGERNAME_MAXIMO, LOGGERNAME_MT, LOGGERNAME_NULLMBOPOINTER, LOGGERNAME_SECURITY, LOGGERNAME_SENDFAILED, LOGGERNAME_SERVICE, LOGGERNAME_SQL, LOGGERNAME_SQL_CRONTASKMGR, LOGGERNAME_TXN, loggerPrefix
Constructor and Description |
---|
DBShortcut()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the connection.
|
void |
commit()
Commit all the SQL statement execution after the prior commit is called.
|
void |
connect(ConnectionKey conKey)
This method obtains a SQL.Connection to the database connected by
MXServer The returned connection is obtained by MXserver.
|
void |
execute(int type,
SqlFormat sqlStat)
Executes the SQL statement.
|
void |
execute(SqlFormat sqlStat)
Executes the SQL statement specified in SqlFormat parameter.
|
java.sql.ResultSet |
executeQuery(java.lang.String sqlStat)
Executes a SQL query and returns the result set.
|
void |
rollBack()
Roll back the sql statements.
|
public int UPDATE
public int QUERY
public int ANY
public void connect(ConnectionKey conKey) throws java.rmi.RemoteException, MXApplicationException
key
- The object acts as a key for MXServer when it looks for the connection.
If you pass the same key everytime, you will get the same connection.java.rmi.RemoteException
MXApplicationException
close()
public void execute(int type, SqlFormat sqlStat) throws MXException
type
- The type of SQL statement.
UPDATE: insert, update type of sql statement;
QUERY: query statement;
ANY: all the other types, or if you don't care about the types.sqlStat
- The sql statement to be executed.java.rmi.RemoteException
MXException
execute(psdi.mbo.SqlFormat)
public void execute(SqlFormat sqlStat) throws MXException
sqlStat
- SqlFormat object which contains a sql statement string to be executed.java.rmi.RemoteException
MXException
execute(int, psdi.mbo.SqlFormat)
public void commit() throws java.sql.SQLException
java.sql.SQLException
public void close()
java.sql.SQLException
java.rmi.RemoteException
public void rollBack() throws java.sql.SQLException
java.sql.SQLException
public java.sql.ResultSet executeQuery(java.lang.String sqlStat)
commit()
is not called.
close()
will have to be calledsqlStat
- The sql statement to be executed.java.rmi.RemoteException
execute(psdi.mbo.SqlFormat)