All Packages Class Hierarchy This Package Previous Next Index
Class com.imaginary.sql.msql.MsqlPreparedStatement
com.imaginary.sql.msql.MsqlStatement
|
+----com.imaginary.sql.msql.MsqlPreparedStatement
- public class MsqlPreparedStatement
- extends MsqlStatement
The MsqlPreparedStatement is an mSQL implementation of the
JDBC PreparedStatement interface. Specifically, it enables an
application to execute the same SQL over and over again without
repeatedly writing logic to build the SQL statements. Instead,
the application just passes new inputs. Because mSQL is completely
unaware of the concept of a PreparedStatement, the mSQL driver
basically hacks it by doing its own parsing and management.
There is still a huge advantage to using the PreparedStatement over
a regular statement in that you never have to worry about date or
String formatting.
Last modified $Date: 1999/07/09 23:16:34 $
- Version:
- $Revision: 1.1.2.1 $
- Author:
- George Reese (borg@imaginary.com)
-
addBatch()
- Adds the current parameter values to the batch list and then clears
the parameters for the next set of parameters.
-
clearParameters()
- Clears the current parameters.
-
execute()
- Executes the stored procedure with its current values.
-
executeQuery()
- Executes the stored query with its current values.
-
executeUpdate()
- Executes the stored update with its current values.
-
getMetaData()
- This errors out because I have not yet figured out a good way to
implement this for mSQL.
-
setAsciiStream(int, InputStream, int)
- Sets the parameter to the data in the specified stream.
-
setBigDecimal(int, BigDecimal)
- Sets the specified parameter to a BigDecimal value.
-
setBinaryStream(int, InputStream, int)
- Sets the parameter to the data in the specified stream.
-
setBoolean(int, boolean)
- Sets the specified parameter to a boolean value.
-
setByte(int, byte)
- Sets the specified parameter to the specified byte value.
-
setBytes(int, byte[])
- Sets the specified parameter to the specified byte value.
-
setCharacterStream(int, Reader, int)
- Sets the parameter to the data in the specified stream.
-
setDate(int, Date)
- Sets the specified parameter to a date value stored in the mSQL
database as a string in the form dd-MMM-yyyy.
-
setDate(int, Date, Calendar)
- Sets the specified parameter to a date value stored in the mSQL
database as a string in the form dd-MMM-yyyy.
-
setDouble(int, double)
- Sets the specified parameter to a double value.
-
setFloat(int, float)
- Sets the specified parameter to a float value.
-
setInt(int, int)
- Sets the specified parameter to an int value.
-
setLong(int, long)
- Sets the specified parameter to a long value.
-
setNull(int, int)
- Sets the specified parameter to a null value.
-
setNull(int, int, String)
- Sets the specified parameter to a null value.
-
setObject(int, Object)
- Sets the specified parameter to a Java object value by calling
ob.toString().
-
setObject(int, Object, int)
- Sets the specified parameter to a Java object value according to the
SQL type specified.
-
setObject(int, Object, int, int)
- Sets the specified parameter to a Java object value according to the
SQL type specified.
-
setShort(int, short)
- Sets the specified parameter to a short value.
-
setString(int, String)
- Sets the specified parameter to a String value.
-
setTime(int, Time)
- Sets the specified parameter to a Time value.
-
setTime(int, Time, Calendar)
- Sets the specified parameter to a Time value.
-
setTimestamp(int, Timestamp)
- Sets the specified parameter to a Timestamp value.
-
setTimestamp(int, Timestamp, Calendar)
- Sets the specified parameter to a Timestamp value.
-
setUnicodeStream(int, InputStream, int)
- Sets the specified parameter to the data contained in the specified
unicode stream.
Deprecated.
addBatch
public void addBatch() throws SQLException
- Adds the current parameter values to the batch list and then clears
the parameters for the next set of parameters.
- Throws: SQLException
- could not add the current parameters
to the batch list
clearParameters
public void clearParameters() throws SQLException
- Clears the current parameters.
- Throws: SQLException
- this is never thrown
execute
public boolean execute() throws SQLException
- Executes the stored procedure with its current values.
- Returns:
- true if the stored procedure generated a result set
- Throws: SQLException
- an error occurred executing the SQL
executeQuery
public ResultSet executeQuery() throws SQLException
- Executes the stored query with its current values.
- Returns:
- the results of the stored procedure
- Throws: SQLException
- an error occurred executing the SQL
executeUpdate
public int executeUpdate() throws SQLException
- Executes the stored update with its current values.
- Returns:
- the number of rows affected by the update
- Throws: SQLException
- an error occurred executing the SQL
getMetaData
public ResultSetMetaData getMetaData() throws SQLException
- This errors out because I have not yet figured out a good way to
implement this for mSQL.
- Returns:
- ResultSetMetaData representing result sets for this stored
procedure
- Throws: SQLException
- this is always thrown
setAsciiStream
public void setAsciiStream(int ind,
InputStream in,
int len) throws SQLException
- Sets the parameter to the data in the specified stream.
- Parameters:
- ind - the parameter to set
- in - the stream containing the data
- len - the number of bytes in the stream
- Throws: SQLException
- an error occurred setting the parameter
setBigDecimal
public void setBigDecimal(int ind,
BigDecimal bd) throws SQLException
- Sets the specified parameter to a BigDecimal value.
- Parameters:
- ind - the parameter to be set
- db - the BigDecimal value
- Throws: SQLException
- an error occurred setting the parameter
setBinaryStream
public void setBinaryStream(int ind,
InputStream in,
int len) throws SQLException
- Sets the parameter to the data in the specified stream.
- Parameters:
- ind - the parameter to set
- in - the stream containing the data
- len - the number of bytes in the stream
- Throws: SQLException
- this is always thrown as mSQL has
no binary object support
setBoolean
public void setBoolean(int ind,
boolean b) throws SQLException
- Sets the specified parameter to a boolean value. Specifically, it
will set the column to the int 1 foor true or 0 for false.
- Parameters:
- ind - the parameter to set
- b - the value to set
- Throws: SQLException
- an error occurred setting the parameter
setByte
public void setByte(int ind,
byte b) throws SQLException
- Sets the specified parameter to the specified byte value.
- Parameters:
- ind - the paramter to be set
- b - the byte value
- Throws: SQLException
- an error occurred setting the paramter
setBytes
public void setBytes(int ind,
byte data[]) throws SQLException
- Sets the specified parameter to the specified byte value.
- Parameters:
- ind - the paramter to be set
- data - the byte array value
- Throws: SQLException
- an error occurred setting the paramter
setCharacterStream
public void setCharacterStream(int ind,
Reader in,
int len) throws SQLException
- Sets the parameter to the data in the specified stream.
- Parameters:
- ind - the parameter to set
- in - the stream containing the data
- len - the number of bytes in the stream
- Throws: SQLException
- an error occurred setting the parameter
setDate
public void setDate(int ind,
Date d) throws SQLException
- Sets the specified parameter to a date value stored in the mSQL
database as a string in the form dd-MMM-yyyy.
- Parameters:
- ind - the parameter to be set
- d - the Date value to set
- Throws: SQLException
- an error occurred setting the parameter
setDate
public void setDate(int ind,
Date d,
Calendar cal) throws SQLException
- Sets the specified parameter to a date value stored in the mSQL
database as a string in the form dd-MMM-yyyy.
- Parameters:
- ind - the parameter to be set
- d - the Date value to set
- cal - the Calendar to use
- Throws: SQLException
- an error occurred setting the parameter
setDouble
public void setDouble(int ind,
double d) throws SQLException
- Sets the specified parameter to a double value.
- Parameters:
- ind - the parameter to be set
- d - the value to set
- Throws: SQLException
- an error occurred setting the parameter
setFloat
public void setFloat(int ind,
float f) throws SQLException
- Sets the specified parameter to a float value.
- Parameters:
- ind - the parameter to be set
- f - the value to set
- Throws: SQLException
- an error occurred setting the parameter
setInt
public void setInt(int ind,
int x) throws SQLException
- Sets the specified parameter to an int value.
- Parameters:
- ind - the parameter to be set
- x - the value to set
- Throws: SQLException
- an error occurred setting the parameter
setLong
public void setLong(int ind,
long l) throws SQLException
- Sets the specified parameter to a long value.
- Parameters:
- ind - the parameter to be set
- l - the value to set
- Throws: SQLException
- an error occurred setting the parameter
setNull
public void setNull(int ind,
int type) throws SQLException
- Sets the specified parameter to a null value.
- Parameters:
- ind - the parameter to be set
- type - the SQL type of the value to be set
- Throws: SQLException
- an error occurred setting the parameter
setNull
public void setNull(int ind,
int type,
String tname) throws SQLException
- Sets the specified parameter to a null value.
- Parameters:
- ind - the parameter to be set
- type - the SQL type of the value to be set
- tname - the name of the UDT
- Throws: SQLException
- an error occurred setting the parameter
setObject
public void setObject(int ind,
Object ob) throws SQLException
- Sets the specified parameter to a Java object value by calling
ob.toString().
- Parameters:
- ind - the parameter to be set
- ob - the object to be set
- Throws: SQLException
- an error occurred setting the parameter
setObject
public void setObject(int ind,
Object ob,
int type) throws SQLException
- Sets the specified parameter to a Java object value according to the
SQL type specified.
- Parameters:
- ind - the parameter to be set
- ob - the object to be set
- type - the target SQL type
- Throws: SQLException
- an error occurred setting the parameter
setObject
public void setObject(int ind,
Object ob,
int type,
int scale) throws SQLException
- Sets the specified parameter to a Java object value according to the
SQL type specified.
- Parameters:
- ind - the parameter to be set
- ob - the object to be set
- type - the target SQL type
- scale - this is ignored
- Throws: SQLException
- an error occurred setting the parameter
setShort
public void setShort(int ind,
short s) throws SQLException
- Sets the specified parameter to a short value.
- Parameters:
- ind - the parameter to be set
- s - the value to set
- Throws: SQLException
- an error occurred setting the parameter
setString
public void setString(int ind,
String str) throws SQLException
- Sets the specified parameter to a String value.
- Parameters:
- ind - the parameter to be set
- str - the value to set
- Throws: SQLException
- an error occurred setting the parameter
setTime
public void setTime(int ind,
Time t) throws SQLException
- Sets the specified parameter to a Time value.
- Parameters:
- ind - the parameter to be set
- t - the value to set
- Throws: SQLException
- an error occurred setting the parameter
setTime
public void setTime(int ind,
Time t,
Calendar cal) throws SQLException
- Sets the specified parameter to a Time value.
- Parameters:
- ind - the parameter to be set
- t - the value to set
- cal - the Calendar to use
- Throws: SQLException
- an error occurred setting the parameter
setTimestamp
public void setTimestamp(int ind,
Timestamp t) throws SQLException
- Sets the specified parameter to a Timestamp value.
- Parameters:
- ind - the parameter to be set
- t - the value to set
- Throws: SQLException
- an error occurred setting the parameter
setTimestamp
public void setTimestamp(int ind,
Timestamp t,
Calendar cal) throws SQLException
- Sets the specified parameter to a Timestamp value.
- Parameters:
- ind - the parameter to be set
- t - the value to set
- cal - the Calendar to use
- Throws: SQLException
- an error occurred setting the parameter
setUnicodeStream
public void setUnicodeStream(int ind,
InputStream in,
int len) throws SQLException
- Note: setUnicodeStream() is deprecated.
use setCharacterStream()
- Sets the specified parameter to the data contained in the specified
unicode stream.
- Parameters:
- ind - the parameter being set
- in - the stream with the data
- len - the number of bytes to be read
- Throws: SQLException
- an error occurred setting the
parameter
All Packages Class Hierarchy This Package Previous Next Index