|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
This class represents the results of a Query.
// Initialize.
SystemManager.init();
// Get the server. Note that you might have to add a server first,
// if this is your first time connecting.
Server srv = SystemManager.getServer("MyServer");
// Set up a login object.
AuthenticationInfo ai = new AuthenticationInfo("foo", "foopass");
// Get a connection.
XConnection xc = srv.getConnection(ai);
// Build up a query. This one just lists Database roots.
String qry = "FOR $a IN root('testDB', 'Mytest') RETURN $a";
// Begin a transaction.
xc.beginTransaction();
// Get a statement object.
XStatement xs = xc.createStatement();
// Voila, the result.
XResultSet result = xs.execute(qry, XStatement.SF_DEFAULT);
// ... work with the results.
FlexStringBuffer fsb = new FlexStringBuffer();
// Get into position... - it defaults to first so you can omit this.
result.beforeFirst();
while (result.nextValue()) {
result.fsbGet(fsb, false);
}
// Close the statement.
xs.close();
// Close the transaction.
xc.commiTransaction();
// Close the connection.
xc.close();
// Exit completely.
SystemManager.shutdown();
// At this point, remember that the results are in fsb.
| Method Summary | |
void |
beforeFirst()
Set the position to one before the first result. |
void |
close()
Release the resources used by this result set. |
void |
emit()
emit the current value to the registered docHandler. |
void |
emitAll()
Emit the entire result set to the registered docHandler. |
void |
fsbGet(FlexStringBuffer fsb,
boolean bAppend)
Get the current value as a string buffer. |
void |
fsbGetAll(FlexStringBuffer fsb,
boolean bAppend)
Get all the values in this result - effectively get all results. |
BigDecimal |
getBigDecimal(String path)
Gets the value of the designated column in the current row of this ResultSet object as a BigDecimal. |
InputStream |
getBinaryStream(String path)
Retrieve the value at the given path as an InputStream of binary values. |
boolean |
getBoolean(String path,
com.bluestream.sys.util.BooleanWrap isNull)
Gets the value of the designated column in the current row of this ResultSet object as a boolean in the Java programming language. |
String |
getCDataText(String path)
Gets the value of the CDATA text of the designated column in the current row of this ResultSet object as a String. |
Date |
getDate(String path)
Gets the value of the designated column in the current row of this ResultSet object as a Date. |
void |
getDocId(FlexStringBuffer docIdStr)
return the document id as an opaque string identifier. |
void |
getDocNum(FlexStringBuffer docNum)
Get the document number for the current document. |
byte |
getEntityEncoding()
Returns the current setting of the Entity Encoding property for this ResultSet. |
boolean |
getFSB(String path,
FlexStringBuffer fsb)
Gets the value of the designated column in the current row of this ResultSet object as a String. |
int |
getInt(String path,
com.bluestream.sys.util.BooleanWrap isNull)
Gets the value of the designated column in the current row of this ResultSet object as an int in the Java programming language. |
long |
getLong(String path,
com.bluestream.sys.util.BooleanWrap isNull)
Gets the value of the designated column in the current row of this ResultSet object as a long in the Java programming language. |
String |
getString()
Get String is for those who want the value returned as a String. |
String |
getString(String path)
Gets the value of the designated column in the current row of this ResultSet object as a String. |
boolean |
nextValue()
Position the result set to the next value in this result set. |
void |
registerDocHandler(XDBDocHandler docHandler)
Register a user provided docHandler as the target for SAX like events. |
void |
registerSaxHandler(org.xml.sax.ContentHandler contentHandler,
org.xml.sax.ext.LexicalHandler lexicalHandler)
Register a user provided content and lexical Handlers as the target for SAXevents. |
void |
setEntityEncoding(String enc)
Configure the ResultSet to encode all entities in returned results. |
void |
setXHTMLTransMode(boolean flag)
|
int |
skipValues(int skipCount)
From the current position in the result set, skip the number of values specified in skipCount. |
void |
xdmValueGetAll(com.bluestream.sys.xml.xdm.XDMValue xdmValue)
Get all the values in the ResultSet as an XDMValue. |
| Method Detail |
public void setEntityEncoding(String enc)
enc - a String which can be one of these values:
public byte getEntityEncoding()
setEntityEncoding(java.lang.String)public void setXHTMLTransMode(boolean flag)
public void beforeFirst()
throws XDBException
XDBException
public boolean nextValue()
throws XDBException
XDBException - - EC_DeadLockRollBack: A deadlock occurred and this thread,
as the victim, was rolled back to break deadlock.
Transaction will be rolled back.
- EC_DuplicateKeyFound: An attempt to insert a duplicate
key into an index was detected. The transaction will be rolled
back to recover from this.
- EC_SchemaValidation: A schema validation failed.
The transaction will be rolled back to recover from this.
- EC_AccessedDenied: Access to perform this operation has
been denied, the transaction will be rolled back automatically.
- EC_Deleted: A request was made to delete a document
that is already deleted. Transaction will be rolled back
automatically.
public int skipValues(int skipCount)
throws XDBException
XDBException - - EC_DeadLockRollBack: A deadlock occurred and this thread,
as the victim, was rolled back to break deadlock.
Transaction will be rolled back.
- EC_DuplicateKeyFound: An attempt to insert a duplicate
key into an index was detected. The transaction will be rolled
back to recover from this.
- EC_SchemaValidation: A schema validation failed.
The transaction will be rolled back to recover from this.
- EC_AccessedDenied: Access to perform this operation has
been denied, the transaction will be rolled back automatically.
- EC_Deleted: A request was made to delete a document
that is already deleted. Transaction will be rolled back
automatically.
public void fsbGet(FlexStringBuffer fsb,
boolean bAppend)
throws XDBException
XDBException
public String getString()
throws XDBException
XDBException
public InputStream getBinaryStream(String path)
throws XDBException
xdbEx - - SysErr.EC_MissingPath: The path specified does not occur in the current value.
XDBException
public long getLong(String path,
com.bluestream.sys.util.BooleanWrap isNull)
throws XDBException
XDBException - - SysErr.EC_MissingPath: The path specified does not occur in the current value.
public int getInt(String path,
com.bluestream.sys.util.BooleanWrap isNull)
throws XDBException
XDBException - - SysErr.EC_MissingPath: The path specified does not occur in the current value.
public boolean getBoolean(String path,
com.bluestream.sys.util.BooleanWrap isNull)
throws XDBException
XDBException - - SysErr.EC_MissingPath: The path specified does not occur in the current value.
public Date getDate(String path)
throws XDBException
XDBException - - SysErr.EC_MissingPath: The path specified does not occur in the current value.
public BigDecimal getBigDecimal(String path)
throws XDBException
XDBException - - SysErr.EC_MissingPath: The path specified does not occur in the current value.
public String getString(String path)
throws XDBException
XDBException - - SysErr.EC_MissingPath: The path specified does not occur in the current value.
public String getCDataText(String path)
throws XDBException
XDBException - - SysErr.EC_MissingPath: The path specified does not occur in the current value.
public boolean getFSB(String path,
FlexStringBuffer fsb)
throws XDBException
XDBException - - SysErr.EC_MissingPath: The path specified does not occur in the current value.
public void emit()
throws XDBException
XDBException
public void fsbGetAll(FlexStringBuffer fsb,
boolean bAppend)
throws XDBException
XDBException
public void xdmValueGetAll(com.bluestream.sys.xml.xdm.XDMValue xdmValue)
throws XDBException
XDBException
public void emitAll()
throws XDBException
XDBException - - EC_DeadLockRollBack: A deadlock occurred and this thread,
as the victim, was rolled back to break deadlock.
Transaction will be rolled back.
- EC_DuplicateKeyFound: An attempt to insert a duplicate
key into an index was detected. The transaction will be rolled
back to recover from this.
- EC_SchemaValidation: A schema validation failed.
The transaction will be rolled back to recover from this.
- EC_AccessedDenied: Access to perform this operation has
been denied, the transaction will be rolled back automatically.
- EC_Deleted: A request was made to delete a document
that is already deleted. Transaction will be rolled back
automatically.
public void registerDocHandler(XDBDocHandler docHandler)
throws XDBException
XDBException
public void registerSaxHandler(org.xml.sax.ContentHandler contentHandler,
org.xml.sax.ext.LexicalHandler lexicalHandler)
throws XDBException
XDBException
public void getDocId(FlexStringBuffer docIdStr)
throws XDBException
XDBException: - thrown if the current node is not a Document node.
XDBException
public void getDocNum(FlexStringBuffer docNum)
throws XDBException
XDBException
public void close()
throws XDBException
XDBException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||