|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.javactionscript.server.ContextualDatabase
public class ContextualDatabase
This resource allows to execute transactional SQL operations in a DBMS. The transaction will start at the RemoteTransaction creation and end with a commit at the RemoteTransaction successful closing or stop with a rollback if an error occurred during the execution of the commands.
It can be configured once for all through ContextFactory.getDatabaseProperties() and then used during the command execution through the ServiceContext object.
A ContextualDatabase resource can be obtained from a ServiceContext instance.
| Method Summary | |
|---|---|
java.sql.ResultSet |
executeSql(java.lang.String $sql,
java.lang.Object[] $parameters)
Creates and execute a PreparedStatement and returns the corresponding ResultSet if the statement is a SELECT query. |
java.util.Date |
executeSqlReturnDate(java.lang.String $sql,
java.lang.Object[] $parameters)
Calls executeSql(String, Object[]) and returns the first cell of the first row of the resultset. |
java.lang.Double |
executeSqlReturnDouble(java.lang.String $sql,
java.lang.Object[] $parameters)
Calls executeSql(String, Object[]) and returns the first cell of the first row of the resultset. |
java.lang.Integer |
executeSqlReturnInteger(java.lang.String $sql,
java.lang.Object[] $parameters)
Calls executeSql(String, Object[]) and returns the first cell of the first row of the resultset. |
java.lang.Long |
executeSqlReturnLong(java.lang.String $sql,
java.lang.Object[] $parameters)
Calls executeSql(String, Object[]) and returns the first cell of the first row of the resultset. |
java.lang.String |
executeSqlReturnString(java.lang.String $sql,
java.lang.Object[] $parameters)
Calls executeSql(String, Object[]) and returns the first cell of the first row of the resultset. |
java.sql.Connection |
getConnection()
Returns the underlying Connection that was retrieved from the pool and dedicated to this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public java.sql.ResultSet executeSql(java.lang.String $sql,
java.lang.Object[] $parameters)
throws java.sql.SQLException
PreparedStatement and returns the corresponding ResultSet if the statement is a SELECT query.
$sql - the SQL command for the PreparedStatement. Remember that it is never recommended to build your statement from request parameters because of possible SQL-injection attacks (use $parameters instead).$parameters - the parameters that will replace the question marks in the SQL command.
ResultSet the corresponding ResultSet if the statement is a SELECT query, or null otherwise.
java.sql.SQLException
public java.lang.Double executeSqlReturnDouble(java.lang.String $sql,
java.lang.Object[] $parameters)
throws java.sql.SQLException
executeSql(String, Object[]) and returns the first cell of the first row of the resultset.
$sql - the SQL command for the PreparedStatement. Remember that it is never recommended to build your statement from request parameters because of possible SQL-injection attacks (use $parameters instead).$parameters - the parameters that will replace the question marks in the SQL command.
ResultSet or no ResultSet at all.
java.sql.SQLException
public java.lang.String executeSqlReturnString(java.lang.String $sql,
java.lang.Object[] $parameters)
throws java.sql.SQLException
executeSql(String, Object[]) and returns the first cell of the first row of the resultset.
$sql - the SQL command for the PreparedStatement. Remember that it is never recommended to build your statement from request parameters because of possible SQL-injection attacks (use $parameters instead).$parameters - the parameters that will replace the question marks in the SQL command.
ResultSet or no ResultSet at all.
java.sql.SQLException
public java.lang.Long executeSqlReturnLong(java.lang.String $sql,
java.lang.Object[] $parameters)
throws java.sql.SQLException
executeSql(String, Object[]) and returns the first cell of the first row of the resultset.
$sql - the SQL command for the PreparedStatement. Remember that it is never recommended to build your statement from request parameters because of possible SQL-injection attacks (use $parameters instead).$parameters - the parameters that will replace the question marks in the SQL command.
ResultSet or no ResultSet at all.
java.sql.SQLException
public java.util.Date executeSqlReturnDate(java.lang.String $sql,
java.lang.Object[] $parameters)
throws java.sql.SQLException
executeSql(String, Object[]) and returns the first cell of the first row of the resultset.
$sql - the SQL command for the PreparedStatement. Remember that it is never recommended to build your statement from request parameters because of possible SQL-injection attacks (use $parameters instead).$parameters - the parameters that will replace the question marks in the SQL command.
ResultSet or no ResultSet at all.
java.sql.SQLException
public java.lang.Integer executeSqlReturnInteger(java.lang.String $sql,
java.lang.Object[] $parameters)
throws java.sql.SQLException
executeSql(String, Object[]) and returns the first cell of the first row of the resultset.
$sql - the SQL command for the PreparedStatement. Remember that it is never recommended to build your statement from request parameters because of possible SQL-injection attacks (use $parameters instead).$parameters - the parameters that will replace the question marks in the SQL command.
ResultSet or no ResultSet at all.
java.sql.SQLExceptionpublic java.sql.Connection getConnection()
Connection that was retrieved from the pool and dedicated to this object.
Connection instance.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||