|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.rocketsoftware.mvapi.AbstractStatement com.rocketsoftware.mvapi.MVStatement
public class MVStatement
Provides methods for executing commands and calling subroutines on the server.
Field Summary |
---|
Fields inherited from interface java.sql.Statement |
---|
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO |
Constructor Summary | |
---|---|
MVStatement(MVConnection mvConnection)
Constructs an MVStatement object from a connection object. |
|
MVStatement(MVConnection mvConnection,
java.lang.String statement)
Constructs an MVStatement object from a connection object and statement. |
Method Summary | |
---|---|
void |
close()
Releases this Statement object's database
resources immediately. |
boolean |
execute(java.lang.String TCL)
Executes a statement on the server. |
MVResultSet |
executeQuery(java.lang.String TCL)
Executes a statement on the server. |
MVResultSet |
executeQuery(java.lang.String filename,
java.lang.String selectionCriteria,
java.lang.String sortCriteria,
java.lang.String ADIList)
Executes a query with the provided selection and sort criteria, then returns the requested columns. |
MVResultSet |
executeQuery(java.lang.String filename,
java.lang.String selectionCriteria,
java.lang.String sortCriteria,
java.lang.String[] ADIArray)
Executes a query with the provided selection and sort criteria, then returns the requested columns. |
MVResultSet |
executeQuery(java.lang.String filename,
java.lang.String selectionCriteria,
java.lang.String sortCriteria,
java.lang.String[] ADIArray,
java.lang.String[] ItemIdArray)
Executes a query with the provided selection and sort criteria, then returns the requested columns. |
MVResultSet |
executeQuery(java.lang.String filename,
java.lang.String selectionCriteria,
java.lang.String sortCriteria,
java.lang.String[] ADIArray,
java.lang.String[] ItemIdArray,
java.lang.String queryKeywords)
Executes a query with the provided selection and sort criteria, then returns the requested columns. |
MVResultSet |
executeQuery(java.lang.String filename,
java.lang.String selectionCriteria,
java.lang.String sortCriteria,
java.lang.String ADIList,
java.lang.String ItemIdList)
Executes a query with the provided selection and sort criteria, then returns the requested columns. |
MVResultSet |
executeQuery(java.lang.String filename,
java.lang.String selectionCriteria,
java.lang.String sortCriteria,
java.lang.String ADIList,
java.lang.String ItemIdList,
java.lang.String queryKeywords)
Executes a query with the provided selection and sort criteria, then returns the requested columns. |
MVConnection |
getConnection()
Return the connection object. |
MVResultSet |
getResultSet()
Retrieves the result as a ResultSet object. |
Methods inherited from class com.rocketsoftware.mvapi.AbstractStatement |
---|
addBatch, cancel, clearBatch, clearWarnings, execute, execute, execute, executeBatch, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MVStatement(MVConnection mvConnection)
mvConnection
- a connection to an MV serverpublic MVStatement(MVConnection mvConnection, java.lang.String statement)
mvConnection
- the connection to the MV serverstatement
- an AQL query, TCL verb or Subroutine.Method Detail |
---|
public MVResultSet executeQuery(java.lang.String TCL) throws MVException
executeQuery
in interface java.sql.Statement
executeQuery
in class AbstractStatement
TCL
- query string:
if the TCL string contains an attribute mark delimiter, the TCL string is interpreted as a subroutine call otherwise the TCL string is interpreted as a TCL command line statement.
For subroutine calls, the TCL string is an attribute mark delimited string, where the first attribute is the subroutine name. The remaining attributes are passed to the subroutine as a dynamic array for the subroutine's first argument, indata. The subroutine must return data through it's second argument, outdata. The outdata is used to populate the ResultSet. Each attribute in the outdata argument generates one row in the generated ResultSet.
The subroutine must be defined to accept two arguments:
subname(indata, outdata)
MVException
- raised if any errors occurpublic MVResultSet executeQuery(java.lang.String filename, java.lang.String selectionCriteria, java.lang.String sortCriteria, java.lang.String ADIList, java.lang.String ItemIdList, java.lang.String queryKeywords) throws MVException
filename
- The filename to query
selectionCriteria
- selection criteria in the native retrieval language syntax
for example: WITH ORDERDATE >= "07/01/09" AND WITH EMPLOYEEID = "10"
sortCriteria
- sort criteria in the native retrieval language syntax
for example BY ORDERDATE BY CUSTOMERID
ADIList
- Attribute defining items to populate the result set
for example ORDERDATE CUSTOMERID EMPLOYEEID PRODUCTID QUANTITY UNITPRICE
ItemIdList
- list of item-Ids to retrieve seperated by spaces.
for example 100 200 300
queryKeywords
- list of AQL keywords delimited by value marks
Currently only the AQL USING keyword is recognized in this parameter to allow using an alternate file dictionary, for example USING DICT ORDERS.DICT
Each row in the resultset will contain an attribute mark delimited string representing the returned item. To retrieve individual columns, use the getString(columnNumber) with columnNumber corresponding to an ADI in the ADIList parameter.
For example getString(4) will return the PRODUCTID.
If the column attribute contains multivalues or subvalues, they can be extracted using the MVString class, for example:
String productID = resultSet.getString(4); String value = MVString.extract(1, 2); // get the second value
MVException
- raised if any errors occurpublic MVResultSet executeQuery(java.lang.String filename, java.lang.String selectionCriteria, java.lang.String sortCriteria, java.lang.String ADIList, java.lang.String ItemIdList) throws MVException
filename
- The filename to query
selectionCriteria
- selection criteria in the native retrieval language syntax
for example: WITH ORDERDATE >= "07/01/09" AND WITH EMPLOYEEID = "10"
sortCriteria
- sort criteria in the native retrieval language syntax
for example BY ORDERDATE BY CUSTOMERID
ADIList
- Attribute defining items to populate the result set
for example ORDERDATE CUSTOMERID EMPLOYEEID PRODUCTID QUANTITY UNITPRICE
ItemIdList
- list of item-Ids to retrieve seperated by spaces.
for example 100 200 300
Each row in the resultset will contain an attribute mark delimited string representing the returned item. To retrieve individual columns, use the getString(columnNumber) with columnNumber corresponding to an ADI in the ADIList parameter.
For example getString(4) will return the PRODUCTID.
If the column attribute contains multivalues or subvalues, they can be extracted using the MVString class, for example:
String productID = resultSet.getString(4); String value = MVString.extract(1, 2); // get the second value
MVException
- raised if any errors occurpublic MVResultSet executeQuery(java.lang.String filename, java.lang.String selectionCriteria, java.lang.String sortCriteria, java.lang.String ADIList) throws MVException
filename
- The filename to query
selectionCriteria
- selection criteria in the native retrieval language syntax
for example: WITH ORDERDATE >= "07/01/09" AND WITH EMPLOYEEID = "10"
sortCriteria
- sort criteria in the native retrieval language syntax
for example BY ORDERDATE BY CUSTOMERID
ADIList
- Attribute defining items to populate the result set
for example ORDERDATE CUSTOMERID EMPLOYEEID PRODUCTID QUANTITY UNITPRICE
Each row in the resultset will contain an attribute mark delimited string representing the returned item. To retrieve individual columns, use the getString(columnNumber) with columnNumber corresponding to an ADI in the ADIList parameter.
For example getString(4) will return the PRODUCTID.
If the column attribute contains multivalues or subvalues, they can be extracted using the MVString class, for example:
String productID = resultSet.getString(4); String value = MVString.extract(1, 2); // get the second value
MVException
- raised if any errors occurpublic MVResultSet executeQuery(java.lang.String filename, java.lang.String selectionCriteria, java.lang.String sortCriteria, java.lang.String[] ADIArray) throws MVException
filename
- The filename to query
selectionCriteria
- selection criteria in the native retrieval language syntax
for example: WITH ORDERDATE >= "07/01/09" AND WITH EMPLOYEEID = "10"
sortCriteria
- sort criteria in the native retrieval language syntax
for example BY ORDERDATE BY CUSTOMERID
ADIArray
- an array of attribute defining items to populate the result set
for example ORDERDATE CUSTOMERID EMPLOYEEID PRODUCTID QUANTITY UNITPRICE
Each row in the resultset will contain an attribute mark delimited string representing the returned item. To retrieve individual columns, use the getString(columnNumber) with columnNumber corresponding to an ADI in the ADIArray parameter.
For example getString(4) will return the PRODUCTID.
If the column attribute contains multivalues or subvalues, they can be extracted using the MVString class, for example:
String productID = resultSet.getString(4); String value = MVString.extract(1, 2); // get the second value
MVException
- raised if any errors occurpublic MVResultSet executeQuery(java.lang.String filename, java.lang.String selectionCriteria, java.lang.String sortCriteria, java.lang.String[] ADIArray, java.lang.String[] ItemIdArray, java.lang.String queryKeywords) throws MVException
filename
- The filename to query
selectionCriteria
- selection criteria in the native retrieval language syntax
for example: WITH ORDERDATE >= "07/01/09" AND WITH EMPLOYEEID = "10"
sortCriteria
- sort criteria in the native retrieval language syntax
for example BY ORDERDATE BY CUSTOMERID
ADIArray
- an array of attribute defining items to populate the result set
for example ORDERDATE CUSTOMERID EMPLOYEEID PRODUCTID QUANTITY UNITPRICE
ItemIdArray
- an array of item-Ids to retrieve seperated by spaces.
for example 100 200 300
queryKeywords
- list of AQL keywords delimited by value marks
Currently only the AQL USING keyword is recognized in this parameter to allow using an alternate file dictionary, for example USING DICT ORDERS.DICT
Each row in the resultset will contain an attribute mark delimited string representing the returned item. To retrieve individual columns, use the getString(columnNumber) with columnNumber corresponding to an ADI in the ADIArray parameter.
For example getString(4) will return the PRODUCTID.
If the column attribute contains multivalues or subvalues, they can be extracted using the MVString class, for example:
String productID = resultSet.getString(4); String value = MVString.extract(1, 2); // get the second value
MVException
- raised if any errors occurpublic MVResultSet executeQuery(java.lang.String filename, java.lang.String selectionCriteria, java.lang.String sortCriteria, java.lang.String[] ADIArray, java.lang.String[] ItemIdArray) throws MVException
filename
- The filename to query
selectionCriteria
- selection criteria in the native retrieval language syntax
for example: WITH ORDERDATE >= "07/01/09" AND WITH EMPLOYEEID = "10"
sortCriteria
- sort criteria in the native retrieval language syntax
for example BY ORDERDATE BY CUSTOMERID
ADIArray
- an array of attribute defining items to populate the result set
for example ORDERDATE CUSTOMERID EMPLOYEEID PRODUCTID QUANTITY UNITPRICE
ItemIdArray
- an array of item-Ids to retrieve seperated by spaces.
for example 100 200 300
Each row in the resultset will contain an attribute mark delimited string representing the returned item. To retrieve individual columns, use the getString(columnNumber) with columnNumber corresponding to an ADI in the ADIArray parameter.
For example getString(4) will return the PRODUCTID.
If the column attribute contains multivalues or subvalues, they can be extracted using the MVString class, for example:
String productID = resultSet.getString(4); String value = MVString.extract(1, 2); // get the second value
MVException
- raised if any errors occurpublic void close() throws MVException
Statement
object's database
resources immediately.
Calling the method close
on a Statement
object that is already closed has no effect.
close
in interface java.sql.Statement
close
in class AbstractStatement
MVException
- if a database access error occurspublic boolean execute(java.lang.String TCL) throws MVException
execute
in interface java.sql.Statement
execute
in class AbstractStatement
TCL
- query string:
if the TCL string contains an attribute mark delimiter, the TCL string is interpreted as a subroutine call otherwise the TCL string is interpreted as a TCL command line statement.
For subroutine calls, the TCL string is an attribute mark delimited string, where the first attribute is the subroutine name. The remaining attributes are passed to the subroutine as a dynamic array for the subroutine's first argument, indata. The subroutine must return data through it's second argument, outdata. The outdata is used to populate the ResultSet. Each attribute in the outdata argument generates one row in the generated ResultSet.
The subroutine must be defined to accept two arguments:
subname(indata, outdata)
MVException
- raised if any errors occurpublic MVResultSet getResultSet() throws MVException
ResultSet
object.
getResultSet
in interface java.sql.Statement
getResultSet
in class AbstractStatement
ResultSet
object
MVException
- if a database access error occursexecute(java.lang.String)
public MVConnection getConnection()
getConnection
in interface java.sql.Statement
getConnection
in class AbstractStatement
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |