|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--vortex.sql.vortexStatement
|
+--vortex.sql.vortexPreparedStatement
A SQL statement is pre-compiled and stored in a PreparedStatement object. This object can then be used to efficiently execute this statement multiple times.
Note: The setXXX methods for setting IN parameter values must specify types that are compatible with the defined SQL type of the input parameter. For instance, if the IN parameter has SQL type Integer then setInt should be used.
If arbitrary parameter type conversions are required then the setObject method should be used with a target SQL type.
Connection.prepareStatement(java.lang.String),
ResultSet| Field Summary | |
protected int |
npa
Number of Parameters |
| Fields inherited from class vortex.sql.vortexStatement |
cName,
conn,
lcur,
ldb,
record,
result |
| Constructor Summary | |
vortexPreparedStatement()
|
|
vortexPreparedStatement(java.sql.Connection c,
dbChannel db,
java.lang.String sql)
|
|
| Method Summary | |
void |
clearParameters()
In general parameter values remain in force for repeated use of a Statement. |
boolean |
execute()
Some prepared statements return multiple results; the execute method handles these complex statements as well as the simpler form of statements handled by executeQuery and executeUpdate. |
java.sql.ResultSet |
executeQuery()
A prepared SQL query is executed and its ResultSet is returned. |
int |
executeUpdate()
Execute a SQL INSERT, UPDATE or DELETE statement. |
void |
setAsciiStream(int col,
java.io.InputStream x,
int length)
When a very large ASCII value is input to a LONGVARCHAR parameter it may be more practical to send it via a java.io.InputStream. |
void |
setBigDecimal(int col,
java.math.BigDecimal x)
Set a parameter to a java.sql.Numeric value. |
void |
setBinaryStream(int col,
java.io.InputStream x,
int length)
When a very large binary value is input to a LONGVARBINARY parameter it may be more practical to send it via a java.io.InputStream. |
void |
setBoolean(int col,
boolean x)
Set a parameter to a Java boolean value. |
void |
setByte(int col,
byte x)
Set a parameter to a Java byte value. |
void |
setBytes(int col,
byte[] x)
Set a parameter to a Java array of bytes. |
void |
setDate(int col,
java.sql.Date x)
Set a parameter to a java.sql.Date value. |
void |
setDouble(int col,
double x)
Set a parameter to a Java double value. |
void |
setFloat(int col,
float x)
Set a parameter to a Java float value. |
void |
setInt(int col,
int x)
Set a parameter to a Java int value. |
void |
setLong(int col,
long x)
Set a parameter to a Java long value. |
void |
setNull(int col,
int sqlType)
Set a parameter to SQL NULL. |
void |
setObject(int col,
java.lang.Object x)
Set the value of a parameter using an object; use the java.lang equivalent objects for integral values. |
void |
setObject(int col,
java.lang.Object x,
int targetSqlType)
This method is like setObject above, but assumes scale of zero. |
void |
setObject(int col,
java.lang.Object x,
int targetSqlType,
int scale)
Set the value of a parameter using an object; use the java.lang equivalent objects for integral values. |
void |
setShort(int col,
short x)
Set a parameter to a Java short value. |
void |
setString(int col,
java.lang.String x)
Set a parameter to a Java String value. |
void |
setTime(int col,
java.sql.Time x)
Set a parameter to a java.sql.Time value. |
void |
setTimestamp(int col,
java.sql.Timestamp x)
Set a parameter to a java.sql.Timestamp value. |
void |
setUnicodeStream(int col,
java.io.InputStream x,
int length)
When a very large UNICODE value is input to a LONGVARCHAR parameter it may be more practical to send it via a java.io.InputStream. |
| Methods inherited from class vortex.sql.vortexStatement |
cancel,
clearWarnings,
close,
execute,
executeQuery,
executeUpdate,
getMaxFieldSize,
getMaxRows,
getMoreResults,
getQueryTimeout,
getResultSet,
getUpdateCount,
getWarnings,
setCursorName,
setEscapeProcessing,
setMaxFieldSize,
setMaxRows,
setQueryTimeout |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected int npa
| Constructor Detail |
public vortexPreparedStatement(java.sql.Connection c,
dbChannel db,
java.lang.String sql)
throws java.sql.SQLException
public vortexPreparedStatement()
throws java.sql.SQLException
| Method Detail |
public java.sql.ResultSet executeQuery()
throws java.sql.SQLException
public int executeUpdate()
throws java.sql.SQLException
public void setNull(int col,
int sqlType)
throws java.sql.SQLException
Note: You must specify the parameter's SQL type.
col - the first parameter is 1, the second is 2, ...sqlType - SQL type code defined by java.sql.Types
public void setBoolean(int col,
boolean x)
throws java.sql.SQLException
col - the first parameter is 1, the second is 2, ...x - the parameter value
public void setByte(int col,
byte x)
throws java.sql.SQLException
col - the first parameter is 1, the second is 2, ...x - the parameter value
public void setShort(int col,
short x)
throws java.sql.SQLException
col - the first parameter is 1, the second is 2, ...x - the parameter value
public void setInt(int col,
int x)
throws java.sql.SQLException
col - the first parameter is 1, the second is 2, ...x - the parameter value
public void setLong(int col,
long x)
throws java.sql.SQLException
col - the first parameter is 1, the second is 2, ...x - the parameter value
public void setFloat(int col,
float x)
throws java.sql.SQLException
col - the first parameter is 1, the second is 2, ...x - the parameter value
public void setDouble(int col,
double x)
throws java.sql.SQLException
col - the first parameter is 1, the second is 2, ...x - the parameter value
public void setBigDecimal(int col,
java.math.BigDecimal x)
throws java.sql.SQLException
col - the first parameter is 1, the second is 2, ...x - the parameter value
public void setString(int col,
java.lang.String x)
throws java.sql.SQLException
col - the first parameter is 1, the second is 2, ...x - the parameter value
public void setBytes(int col,
byte[] x)
throws java.sql.SQLException
col - the first parameter is 1, the second is 2, ...x - the parameter value
public void setDate(int col,
java.sql.Date x)
throws java.sql.SQLException
col - the first parameter is 1, the second is 2, ...x - the parameter value
public void setTime(int col,
java.sql.Time x)
throws java.sql.SQLException
col - the first parameter is 1, the second is 2, ...x - the parameter value
public void setTimestamp(int col,
java.sql.Timestamp x)
throws java.sql.SQLException
col - the first parameter is 1, the second is 2, ...x - the parameter value
public void setAsciiStream(int col,
java.io.InputStream x,
int length)
throws java.sql.SQLException
Note: this stream object can either be a standard Java stream object, or your own subclass that implements the standard interface.
col - the first parameter is 1, the second is 2, ...x - the java input stream which contains the ASCII parameter valuelength - the number of bytes in the stream
public void setUnicodeStream(int col,
java.io.InputStream x,
int length)
throws java.sql.SQLException
Note: this stream object can either be a standard Java stream object, or your own subclass that implements the standard interface.
col - the first parameter is 1, the second is 2, ...x - the java input stream which contains the
UNICODE parameter value @param length the number of bytes in
the stream
public void setBinaryStream(int col,
java.io.InputStream x,
int length)
throws java.sql.SQLException
Note: this stream object can either be a standard Java stream object, or your own subclass that implements the standard interface.
col - the first parameter is 1, the second is 2, ...x - the java input stream which contains the binary parameter valuelength - the number of bytes in the stream
public void clearParameters()
throws java.sql.SQLException
public void setObject(int col,
java.lang.Object x,
int targetSqlType,
int scale)
throws java.sql.SQLException
The given Java object will be converted to the targetSqlType before being sent to the database.
Note that this method may be used to pass datatabase specific abstract data types, by using a Driver specific Java type and using a targetSqlType of java.sql.types.OTHER.
col - The first parameter is 1, the second is 2, ...x - The object containing the input parameter valuetargetSqlType - The SQL type (as defined in java.sql.Types) to be
sent to the database. The scale argument may further qualify this type.scale - For java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types
this is the number of digits after the decimal. For all other
types this value will be ignored,java.sql.Types
public void setObject(int col,
java.lang.Object x,
int targetSqlType)
throws java.sql.SQLException
col - The first parameter is 1, the second is 2, ...x - The object containing the input parameter valuetargetSqlType - The SQL type (as defined in java.sql.Types) to be
sent to the database.
public void setObject(int col,
java.lang.Object x)
throws java.sql.SQLException
The JDBC specification specifies a standard mapping from Java Object types to SQL types. The given argument java object will be converted to the corresponding SQL type before being sent to the database.
Note that this method may be used to pass database specific abstract data types, by using a Driver specific Java type.
col - The first parameter is 1, the second is 2, ...x - The object containing the input parameter value
public boolean execute()
throws java.sql.SQLException
Statement.execute(java.lang.String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||