|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.slamd.scripting.engine.Variable
com.sun.slamd.scripting.jdbc.JDBCConnectionVariable
This class defines a variable that provides an interface to the JDBC
Connection object that can be used to interact with relational
databases. A JDBC connection variable provides the following methods:
| Field Summary | |
static java.lang.String |
COMMIT_METHOD_NAME
The name of the method that can be used to commit outstanding changes to the database. |
static int |
COMMIT_METHOD_NUMBER
The method number for the "commit" method. |
static int |
CONNECT_1_METHOD_NUMBER
The method number for the first "connect" method. |
static int |
CONNECT_2_METHOD_NUMBER
The method number for the second "connect" method. |
static java.lang.String |
CONNECT_METHOD_NAME
The name of the method that can be used to establish connections to a database. |
static java.lang.String |
DISCONNECT_METHOD_NAME
The name of the method that can be used to disconnect from the database. |
static int |
DISCONNECT_METHOD_NUMBER
The method number for the "close" method. |
static java.lang.String |
EXECUTE_QUERY_METHOD_NAME
The name of the method that can be used to execute a query in the database. |
static int |
EXECUTE_QUERY_METHOD_NUMBER
The method number for the "executeQuery" method. |
static java.lang.String |
EXECUTE_UPDATE_METHOD_NAME
The name of the method that can be used to execute an update in the database. |
static int |
EXECUTE_UPDATE_METHOD_NUMBER
The method number for the "executeUpdate" method. |
static java.lang.String |
GET_AUTO_COMMIT_METHOD_NAME
The name of the method that can be used to determine whether autocommit is enabled in the database. |
static int |
GET_AUTO_COMMIT_METHOD_NUMBER
The method number for the "getAutoCommit" method. |
static java.lang.String |
GET_FAILURE_REASON_METHOD_NAME
The name of the method that can be used to retrieve information about the reason that the last operation failed. |
static int |
GET_FAILURE_REASON_METHOD_NUMBER
The method number for the "getFailureReason" method. |
static java.lang.String |
GET_LOGIN_TIMEOUT_METHOD_NAME
The name of the method that can be used to retrieve the login timeout that has been configured. |
static int |
GET_LOGIN_TIMEOUT_METHOD_NUMBER
The method number for the "getLoginTimeout" method. |
static java.lang.String |
GET_QUERY_TIMEOUT_METHOD_NAME
The name of the method that can be used to retrieve the query timeout that has been configured. |
static int |
GET_QUERY_TIMEOUT_METHOD_NUMBER
The method number for the "getQueryTimeout" method. |
static java.lang.String |
IS_CONNECTED_METHOD_NAME
The name of the method that can be used to determine whether this connection is currently established. |
static int |
IS_CONNECTED_METHOD_NUMBER
The method number for the "isConnected" method. |
static Method[] |
JDBC_CONNECTION_VARIABLE_METHODS
The set of methods associated with JDBC connection variables. |
static java.lang.String |
JDBC_CONNECTION_VARIABLE_TYPE
The name that will be used for the data type of JDBC connection variables. |
static java.lang.String |
PREPARE_STATEMENT_METHOD_NAME
The name of the method that can be used to create a prepared statement. |
static int |
PREPARE_STATEMENT_METHOD_NUMBER
The method number for the "prepareStatement" method. |
static java.lang.String |
ROLL_BACK_METHOD_NAME
The name of the method that can be used to roll back any outstanding changes. |
static int |
ROLL_BACK_METHOD_NUMBER
The method number for the "rollBack" method. |
static java.lang.String |
SET_AUTO_COMMIT_METHOD_NAME
The name of the method that can be used to enable or disable autocommit in the database. |
static int |
SET_AUTO_COMMIT_METHOD_NUMBR
The method number for the "setAutoCommit" method. |
static java.lang.String |
SET_DRIVER_CLASS_METHOD_NAME
The name of the method that can be used to specify the JDBC driver class to use. |
static int |
SET_DRIVER_CLASS_METHOD_NUMBER
The method number for the "setDriverClass" method. |
static java.lang.String |
SET_LOGIN_TIMEOUT_METHOD_NAME
The name of the method that can be used to specify the login timeout. |
static int |
SET_LOGIN_TIMEOUT_METHOD_NUMBER
The method number for the "setLoginTimeout" method. |
static java.lang.String |
SET_QUERY_TIMEOUT_METHOD_NAME
The name of the method that can be used to specify the query timeout. |
static int |
SET_QUERY_TIMEOUT_METHOD_NUMBER
The method number for the "setQueryTimeout" method. |
| Constructor Summary | |
JDBCConnectionVariable()
Creates a new variable with no name, to be used only when creating a variable with Class.newInstance(), and only when
setName() is called after that to set the name. |
|
| Method Summary | |
void |
assign(Argument argument)
Assigns the value of the provided argument to this variable. |
Variable |
executeMethod(int lineNumber,
int methodNumber,
Argument[] arguments)
Executes the specified method, using the provided variables as arguments to the method, and makes the return value available to the caller. |
int |
getMethodNumber(java.lang.String methodName,
java.lang.String[] argumentTypes)
Retrieves the method number for the method that has the specified name and argument types, or -1 if there is no such method. |
Method[] |
getMethods()
Retrieves a list of all methods defined for this variable. |
java.lang.String |
getReturnTypeForMethod(java.lang.String methodName,
java.lang.String[] argumentTypes)
Retrieves the return type for the method with the specified name and argument types. |
java.lang.String |
getValueAsString()
Retrieves a string representation of the value of this argument. |
java.lang.String |
getVariableTypeName()
Retrieves the name of the variable type for this variable. |
boolean |
hasMethod(java.lang.String methodName)
Indicates whether this variable type has a method with the specified name. |
| Methods inherited from class com.sun.slamd.scripting.engine.Variable |
getArgumentAsString, getArgumentType, getArgumentValue, getName, getStatTrackers, isValidIdentifier, setName, startStatTrackers, stopStatTrackers |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String JDBC_CONNECTION_VARIABLE_TYPE
public static final java.lang.String COMMIT_METHOD_NAME
public static final int COMMIT_METHOD_NUMBER
public static final java.lang.String CONNECT_METHOD_NAME
public static final int CONNECT_1_METHOD_NUMBER
public static final int CONNECT_2_METHOD_NUMBER
public static final java.lang.String DISCONNECT_METHOD_NAME
public static final int DISCONNECT_METHOD_NUMBER
public static final java.lang.String EXECUTE_QUERY_METHOD_NAME
public static final int EXECUTE_QUERY_METHOD_NUMBER
public static final java.lang.String EXECUTE_UPDATE_METHOD_NAME
public static final int EXECUTE_UPDATE_METHOD_NUMBER
public static final java.lang.String GET_AUTO_COMMIT_METHOD_NAME
public static final int GET_AUTO_COMMIT_METHOD_NUMBER
public static final java.lang.String GET_FAILURE_REASON_METHOD_NAME
public static final int GET_FAILURE_REASON_METHOD_NUMBER
public static final java.lang.String GET_LOGIN_TIMEOUT_METHOD_NAME
public static final int GET_LOGIN_TIMEOUT_METHOD_NUMBER
public static final java.lang.String GET_QUERY_TIMEOUT_METHOD_NAME
public static final int GET_QUERY_TIMEOUT_METHOD_NUMBER
public static final java.lang.String IS_CONNECTED_METHOD_NAME
public static final int IS_CONNECTED_METHOD_NUMBER
public static final java.lang.String PREPARE_STATEMENT_METHOD_NAME
public static final int PREPARE_STATEMENT_METHOD_NUMBER
public static final java.lang.String ROLL_BACK_METHOD_NAME
public static final int ROLL_BACK_METHOD_NUMBER
public static final java.lang.String SET_AUTO_COMMIT_METHOD_NAME
public static final int SET_AUTO_COMMIT_METHOD_NUMBR
public static final java.lang.String SET_DRIVER_CLASS_METHOD_NAME
public static final int SET_DRIVER_CLASS_METHOD_NUMBER
public static final java.lang.String SET_LOGIN_TIMEOUT_METHOD_NAME
public static final int SET_LOGIN_TIMEOUT_METHOD_NUMBER
public static final java.lang.String SET_QUERY_TIMEOUT_METHOD_NAME
public static final int SET_QUERY_TIMEOUT_METHOD_NUMBER
public static final Method[] JDBC_CONNECTION_VARIABLE_METHODS
| Constructor Detail |
public JDBCConnectionVariable()
throws ScriptException
Class.newInstance(), and only when
setName() is called after that to set the name.
ScriptException - If a problem occurs while initializing the new
variable.| Method Detail |
public java.lang.String getVariableTypeName()
getVariableTypeName in class Variablepublic Method[] getMethods()
getMethods in class Variablepublic boolean hasMethod(java.lang.String methodName)
hasMethod in class VariablemethodName - The name of the method.
true if this variable has a method with the specified
name, or false if it does not.
public int getMethodNumber(java.lang.String methodName,
java.lang.String[] argumentTypes)
getMethodNumber in class VariablemethodName - The name of the method.argumentTypes - The list of argument types for the method.
public java.lang.String getReturnTypeForMethod(java.lang.String methodName,
java.lang.String[] argumentTypes)
getReturnTypeForMethod in class VariablemethodName - The name of the method.argumentTypes - The set of argument types for the method.
null if there is
no such method defined.
public Variable executeMethod(int lineNumber,
int methodNumber,
Argument[] arguments)
throws ScriptException
executeMethod in class VariablelineNumber - The line number of the script in which the method
call occurs.methodNumber - The method number of the method to execute.arguments - The set of arguments to use for the method.
null if it
does not return a value.
ScriptException - If the specified method does not exist, or if a
problem occurs while attempting to execute it.
public void assign(Argument argument)
throws ScriptException
assign in class Variableargument - The argument whose value should be assigned to this
variable.
ScriptException - If a problem occurs while performing the
assignment.public java.lang.String getValueAsString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||