Synopsis
public QueryResultSet
query(PreparedStatement query,
java.lang.String[] selectKeys,
int resultsPerFetch)
Description
Takesa where clause and a select clause and returns a QueryResultSet of NameValueRecord
instancescontaining the selected values.
selectKeysidenties the values to be returned, functioning as an SQL select clause.
ThePreparedStatement parameter enables queries with dynamic parameters to pass typed data
itemsto the query.
Returnsa QueryResultSet. The results are stepped through by calling the next method and
usingthe getObjectIdentifier accessor.
Note– For more information on the 5800 system query language, refer to Chapter 4, “Sun
StorageTek5800 System Query Language.”
PreparedStatement
Extendscom.sun.honeycomb.common.Encoding
Synopsis
public PreparedStatement(java.lang.String sql);
Description
Usedto implement queries with Dynamic Parameters, which is the preferred way to pass typed
dataitems to a StorageTek 5800 query.
Thenumber of bindParameter calls should match the number of question marks (?) in the
querystring in the prepared statement. Parameters are specied positionally. For example, a
bindParametercall with index = 1 supplies a value for the rst ?in the supplied query string.
Oncea value has been supplied for each of the dynamic parameters, then the
PreparedStatementmay be passed to the NameValueObjectArchive.query method to be
executed,for example:
NameValueObjectArchive archive = new NameValueObjectArchive(hostname);
Date date_value= new java.sql.Date();
PreparedStatement stmt = new PreparedStatement("date_field<?”);
JavaAPI
SunStorageTek5800 System Client API Reference Manual • June 200836