public abstract class Query
extends java.lang.Object
This class defines methods for executing queries.
It is implemented by ClientQuery.
Results are either returned as string or serialized to the output
stream that has been specified via the constructor or via
Session.setOutputStream(OutputStream).
| Modifier and Type | Field and Description |
|---|---|
protected TokenList |
cache
Cached results.
|
protected java.io.OutputStream |
out
Client output stream.
|
protected int |
pos
Cache pointer.
|
| Constructor and Description |
|---|
Query() |
| Modifier and Type | Method and Description |
|---|---|
void |
bind(java.lang.String n,
java.lang.Object v)
Binds a value to an external variable.
|
abstract void |
bind(java.lang.String n,
java.lang.Object v,
java.lang.String t)
Binds a value with an optional type to an external variable.
|
protected abstract void |
cache()
Caches the query result.
|
protected void |
cache(java.io.InputStream is)
Caches the incoming input.
|
abstract void |
close()
Closes the query.
|
void |
context(java.lang.Object v)
Binds a value to the context item.
|
abstract void |
context(java.lang.Object v,
java.lang.String t)
Binds a value with an optional type to an external variable.
|
abstract java.lang.String |
execute()
Returns the complete result of the query.
|
abstract java.lang.String |
info()
Returns query info.
|
boolean |
more()
Returns
true if more items are available. |
java.lang.String |
next()
Returns the next item of the query.
|
abstract java.lang.String |
options()
Returns the serialization options.
|
abstract boolean |
updating()
Returns
true if the query may perform updates. |
protected java.io.OutputStream out
protected TokenList cache
protected int pos
public final void bind(java.lang.String n,
java.lang.Object v)
throws java.io.IOException
n - name of variablev - value to be boundjava.io.IOException - I/O exceptionpublic abstract void bind(java.lang.String n,
java.lang.Object v,
java.lang.String t)
throws java.io.IOException
n - name of variablev - value to be boundt - data type (may be null)java.io.IOException - I/O exceptionpublic final void context(java.lang.Object v)
throws java.io.IOException
v - value to be boundjava.io.IOException - I/O exceptionpublic abstract void context(java.lang.Object v,
java.lang.String t)
throws java.io.IOException
v - value to be boundt - data type (may be null)java.io.IOException - I/O exceptionpublic boolean more()
throws java.io.IOException
true if more items are available.java.io.IOException - I/O exceptionprotected abstract void cache()
throws java.io.IOException
java.io.IOException - I/O exceptionpublic final java.lang.String next()
throws java.io.IOException
null.java.io.IOException - I/O exceptionprotected void cache(java.io.InputStream is)
throws java.io.IOException
is - input streamjava.io.IOException - I/O exceptionpublic abstract java.lang.String execute()
throws java.io.IOException
null.java.io.IOException - I/O exceptionpublic abstract java.lang.String options()
throws java.io.IOException
java.io.IOException - I/O exceptionpublic abstract boolean updating()
throws java.io.IOException
true if the query may perform updates.java.io.IOException - I/O exceptionpublic abstract java.lang.String info()
throws java.io.IOException
java.io.IOException - I/O exceptionpublic abstract void close()
throws java.io.IOException
java.io.IOException - I/O exception