public interface Query
Abstraction of a generic Query, hiding the details of any protocol-version-specific data needed to execute the query efficiently.
Query objects should be explicitly closed when no longer needed; if resources are allocated on the server for this query, their cleanup is triggered by closing the Query.
Modifier and Type | Method and Description |
---|---|
void |
close()
Close this query and free any server-side resources associated with it.
|
ParameterList |
createParameterList()
Create a ParameterList suitable for storing parameters associated with this Query.
|
int |
getBatchSize()
Get the number of times this Query has been batched.
|
String |
getNativeSql()
Returns SQL in native for database format.
|
@Nullable Map<String,Integer> |
getResultSetColumnNameIndexMap()
Get a map that a result set can use to find the index associated to a name.
|
@Nullable SqlCommand |
getSqlCommand()
Returns properties of the query (sql keyword, and some other parsing info).
|
Query[] |
getSubqueries()
Return a list of the Query objects that make up this query.
|
boolean |
isEmpty() |
boolean |
isStatementDescribed() |
String |
toString(@Nullable ParameterList parameters)
Stringize this query to a human-readable form, substituting particular parameter values for
parameter placeholders.
|
ParameterList createParameterList()
Create a ParameterList suitable for storing parameters associated with this Query.
If this query has no parameters, a ParameterList will be returned, but it may be a shared immutable object. If this query does have parameters, the returned ParameterList is a new list, unshared by other callers.
String toString(@Nullable ParameterList parameters)
parameters
- a ParameterList returned by this Query's createParameterList()
method,
or null
to leave the parameter placeholders unsubstituted.String getNativeSql()
@Nullable SqlCommand getSqlCommand()
void close()
Close this query and free any server-side resources associated with it. The resources may not be immediately deallocated, but closing a Query may make the deallocation more prompt.
A closed Query should not be executed.
boolean isStatementDescribed()
boolean isEmpty()
int getBatchSize()
addBatch()
has been called.@Nullable Map<String,Integer> getResultSetColumnNameIndexMap()
Query[] getSubqueries()
null
if this object is already a
single-statement query.Copyright © 1997-2020 PostgreSQL Global Development Group. All Rights Reserved.