|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface JDBCScript
A request object which can be executed by
IScriptEngine.execute(request)
method.
An object of this class is created using
createDatabaseQueryRequest
method of IScriptEngine. Once the
object is created, it should be populated as per the requirements of the JDBC
protocol and then executed using IScriptEngine.
IScriptEngine
,
IScriptEngine.createDatabaseQueryRequest(int, String)
Method Summary | |
---|---|
void |
addThinkTime(int virtualUser,
int type,
int startValue,
int endValue,
int valueType)
Delay in seconds before the task is actually executed. |
boolean |
assertColumn(java.lang.String colName,
java.lang.String dataType,
java.lang.String value)
Once the task is executed, this method can be used to validate the column present in the result set. |
boolean |
assertColumn(java.lang.String colName,
java.lang.String dataType,
java.lang.String[] values)
Once the task is executed, this method can be used to validate the column present in the result set. |
boolean |
assertColumnNames(java.lang.String[] colNames,
boolean inOrder)
Once the task is executed, this method can be used to validate the columns present in the result set. |
boolean |
assertRow(int rowIndex,
java.lang.String[] dataTypes,
java.lang.String[] values)
Once the task is executed, this method can be used to validate the all the columns present in the result set at the specified row. |
boolean |
assertRowCount(int count)
Once the task is executed, this method can be used to validate the no of rows present in the result set. |
java.sql.CallableStatement |
getCallableStatement()
Callable statement created using the stored procedure |
java.lang.Object |
getOutputValue(int parameterIndex)
This method returns value of the OUT type of Stored procedure after the task is executed |
int |
getResponseCode()
Get Response Code for the task execution |
long |
getResponseTime()
Get the response time of executed task |
boolean |
isStoredProcedure()
Whether this task will fire a stored procedure |
java.lang.String |
loadQueryFromFile(java.lang.String fileName)
This method sets the file name from which the query is read and executed when the task is executed |
void |
registerStoredProcedureParameter(int parameterIndex,
boolean in,
boolean out,
int parameterType)
Register parameters of a Stored procedure |
void |
replaceParameterInQuery(java.lang.String parameterName,
java.lang.String parameterValue)
Application supports parameterized queries. |
void |
replaceParameterInQuery(java.lang.String parameterName,
java.lang.String parameterValue,
java.lang.String encodeChar)
Application supports parameterized queries. |
void |
setInputValue(int parameterIndex,
java.lang.String value)
Sets the value of the IN type of the stored procedure parameters |
java.lang.String |
setQuery(java.lang.String query)
This method sets the SQL query to be executed when the task is executed |
java.lang.String |
setQuery(java.lang.String query,
java.lang.String paramEncodeChar)
|
void |
setResponseTime(long responseTimeInMillis)
This can be used to set value of session parameter. |
void |
setStoredProcedure(boolean storedProc)
Whether this task will fire a stored procedure |
Methods inherited from interface com.appperfect.devcommon.script.IScript |
---|
getReasonForFailure, isIgnored, isTaskSuccessful, isTaskTimedOut, setIgnored, setReasonForFailure, setTaskSuccessful, setTaskTimedout, setThinkTime, setTimeout |
Method Detail |
---|
void addThinkTime(int virtualUser, int type, int startValue, int endValue, int valueType)
virtualUser
- % Virtual User who should use this think time settingtype
- Type of value whether its Fixed (0) value or Random Value (1)startValue
- Think time valueendValue
- End value of think time in case of random valuevalueType
- Whether value specified is in seconds (0) or in milliseconds (1)boolean assertColumn(java.lang.String colName, java.lang.String dataType, java.lang.String value)
colName
- name of the columndataType
- data type of the columnvalue
- value in the column at current row
true
if the validation matches the expected
results; false
otherwiseboolean assertColumn(java.lang.String colName, java.lang.String dataType, java.lang.String[] values)
colName
- name of the columndataType
- data type of the columnvalues
- coma seperated values for that column
true
if the validation matches the expected
results; false
otherwiseboolean assertColumnNames(java.lang.String[] colNames, boolean inOrder)
colNames
- list of column namesinOrder
- true
if order of columns is required;
false
otherwise
true
if the validation matches the expected column
names; false
otherwiseboolean assertRow(int rowIndex, java.lang.String[] dataTypes, java.lang.String[] values)
rowIndex
- row index. Index starts with 1, 2, 3 ...dataTypes
- list of column data typesvalues
- list of values in each column
true
if the validation matches the expected
results; false
otherwiseboolean assertRowCount(int count)
count
- expected number of rows
true
if the number of rows in the result set
matches count; false
otherwisejava.sql.CallableStatement getCallableStatement()
java.lang.Object getOutputValue(int parameterIndex)
parameterIndex
- index in the stored procedure sql statement
int getResponseCode()
long getResponseTime()
boolean isStoredProcedure()
java.lang.String loadQueryFromFile(java.lang.String fileName)
fileName
- containing the query to be executed returns the query read
from the filevoid registerStoredProcedureParameter(int parameterIndex, boolean in, boolean out, int parameterType)
parameterIndex
- index in the stored procedure sql statementin
- true if its an IN parameterout
- true if its an OUT parameterparameterType
- type of the parameter java.sql.Typesvoid replaceParameterInQuery(java.lang.String parameterName, java.lang.String parameterValue)
parameterName
- name of the parameterparameterValue
- value of the parametervoid replaceParameterInQuery(java.lang.String parameterName, java.lang.String parameterValue, java.lang.String encodeChar)
parameterName
- name of the parameterparameterValue
- value of the parameterencodeChar
- character used to enclose parameter namevoid setInputValue(int parameterIndex, java.lang.String value)
parameterIndex
- index in the stored procedure sql statementvalue
- of the IN type parameterjava.lang.String setQuery(java.lang.String query)
query
- to be executed
java.lang.String setQuery(java.lang.String query, java.lang.String paramEncodeChar)
query
- to be executedparamEncodeChar
- character to be used for enclosing TestParameter if any in the
query, by default @ is used for enclosing TestParameter within query
void setResponseTime(long responseTimeInMillis)
responseTimeInMillis
- void setStoredProcedure(boolean storedProc)
storedProc
- true if its a stored procedure else false
|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |