public final class SQLQuery extends Object
FUTURE ENHANCEMENTS: This could do some preliminary parsing of the query string for faster translation by the database.
Constructor and Description |
---|
SQLQuery(String query)
Constructs the query.
|
Modifier and Type | Method and Description |
---|---|
void |
addVar(Object ob)
Adds a variable to the query.
|
void |
clear()
Clears all the parameters.
|
SQLQuery |
copy()
Creates an exact copy of this object.
|
static SQLQuery |
deserializeFromBlob(ByteLongObject ob)
Deserializes an SQLQuery object from a ByteLongObject.
|
boolean |
equals(Object ob)
Returns true if this query is equal to another.
|
String |
getQuery()
Returns the query string.
|
Object[] |
getVars()
Returns the array of all objects that are to be used as substitutions
for '?' in the query.
|
void |
prepare(boolean do_escape_processing)
Prepares the query by parsing the query string and performing any updates
that are required before being passed down to the lower layers of the
database engine for processing.
|
static SQLQuery |
readFrom(DataInputStream in)
Reads an SQLQuery object from the data input stream.
|
ByteLongObject |
serializeToBlob()
Serializes an SQLQuery object to a ByteLongObject.
|
void |
setVar(int i,
Object ob)
Sets a variable at the given index.
|
String |
toString()
Outputs the query as text (for debugging)
|
void |
writeTo(DataOutputStream out)
Writes the SQL query to the data output stream.
|
public SQLQuery(String query)
public void addVar(Object ob)
public void setVar(int i, Object ob)
public void clear()
public String getQuery()
public Object[] getVars()
NOTE: Array returned references internal Object[] here so don't change!
public void prepare(boolean do_escape_processing) throws SQLException
SQLException
public boolean equals(Object ob)
public SQLQuery copy()
public String toString()
public void writeTo(DataOutputStream out) throws IOException
IOException
public static SQLQuery readFrom(DataInputStream in) throws IOException
IOException
public ByteLongObject serializeToBlob()
public static SQLQuery deserializeFromBlob(ByteLongObject ob)
Copyright © 2015. All rights reserved.