| Overview | Package | Class | Tree | Deprecated | Index | Help | |||
| PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||
java.lang.Object
|
+--org.gjt.mm.mysql.Statement
|
+--org.gjt.mm.mysql.PreparedStatement
| Constructor Summary | |
| PreparedStatement(Connection Conn,
java.lang.String Sql)
Constructor for the PreparedStatement class. |
|
| Method Summary | |
| void | clearParameters()
In general, parameter values remain in force for repeated used 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 parameterIndex,
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. |
| void | setBigDecimal(int parameterIndex,
java.math.BigDecimal X)
Set a parameter to a java.lang. |
| void | setBinaryStream(int parameterIndex,
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. |
| void | setBoolean(int parameterIndex,
boolean x)
Set a parameter to a Java boolean value. |
| void | setByte(int parameterIndex,
byte x)
Set a parameter to a Java byte value. |
| void | setBytes(int parameterIndex,
byte[] x)
Set a parameter to a Java array of bytes. |
| void | setDate(int parameterIndex,
java.sql.Date X)
Set a parameter to a java.sql. |
| void | setDouble(int parameterIndex,
double x)
Set a parameter to a Java double value. |
| void | setFloat(int parameterIndex,
float x)
Set a parameter to a Java float value. |
| void | setInt(int parameterIndex,
int x)
Set a parameter to a Java int value. |
| void | setLong(int parameterIndex,
long x)
Set a parameter to a Java long value. |
| void | setNull(int parameterIndex,
int sqlType)
Set a parameter to SQL NULL Note: You must specify the parameters SQL type (although PostgreSQL ignores it) |
| void | setObject(int parameterIndex,
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 | setObject(int parameterIndex,
java.lang.Object X,
int targetSqlType)
|
| void | setObject(int parameterIndex,
java.lang.Object X)
|
| void | setShort(int parameterIndex,
short x)
Set a parameter to a Java short value. |
| void | setString(int parameterIndex,
java.lang.String X)
Set a parameter to a Java String value. |
| void | setTime(int parameterIndex,
java.sql.Time X)
Set a parameter to a java.sql. |
| void | setTimestamp(int parameterIndex,
java.sql.Timestamp X)
Set a parameter to a java.sql. |
| void | setUnicodeStream(int parameterIndex,
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. |
| Methods inherited from class org.gjt.mm.mysql.Statement | |
| cancel, clearWarnings, close, executeQuery, execute, 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, notifyAll, notify, toString, wait, wait, wait | |
| Constructor Detail |
public PreparedStatement(Connection Conn,
java.lang.String Sql)
throws java.sql.SQLException
conn
- the instanatiating connection
sql
- the SQL statement with ? for IN markers| Method Detail |
public java.sql.ResultSet executeQuery()
throws java.sql.SQLException
public int executeUpdate()
throws java.sql.SQLException
public void setNull(int parameterIndex,
int sqlType)
throws java.sql.SQLException
Note: You must specify the parameters SQL type (although PostgreSQL ignores it)
parameterIndex
- the first parameter is 1, etc...
sqlType
- the SQL type code defined in java.sql.Types
public void setBoolean(int parameterIndex,
boolean x)
throws java.sql.SQLException
parameterIndex
- the first parameter is 1...
x
- the parameter value
public void setByte(int parameterIndex,
byte x)
throws java.sql.SQLException
parameterIndex
- the first parameter is 1...
x
- the parameter value
public void setShort(int parameterIndex,
short x)
throws java.sql.SQLException
parameterIndex
- the first parameter is 1...
x
- the parameter value
public void setInt(int parameterIndex,
int x)
throws java.sql.SQLException
parameterIndex
- the first parameter is 1...
x
- the parameter value
public void setLong(int parameterIndex,
long x)
throws java.sql.SQLException
parameterIndex
- the first parameter is 1...
x
- the parameter value
public void setFloat(int parameterIndex,
float x)
throws java.sql.SQLException
parameterIndex
- the first parameter is 1...
x
- the parameter value
public void setDouble(int parameterIndex,
double x)
throws java.sql.SQLException
parameterIndex
- the first parameter is 1...
x
- the parameter value
public void setBigDecimal(int parameterIndex,
java.math.BigDecimal X)
throws java.sql.SQLException
parameterIndex
- the first parameter is 1...
x
- the parameter value
public void setString(int parameterIndex,
java.lang.String X)
throws java.sql.SQLException
parameterIndex
- the first parameter is 1...
x
- the parameter value
public void setBytes(int parameterIndex,
byte[] x)
throws java.sql.SQLException
parameterIndex
- the first parameter is 1...
x
- the parameter value
public void setDate(int parameterIndex,
java.sql.Date X)
throws java.sql.SQLException
parameterIndex
- the first parameter is 1...
x
- the parameter value
public void setTime(int parameterIndex,
java.sql.Time X)
throws java.sql.SQLException
parameterIndex
- the first parameter is 1...));
x
- the parameter value
public void setTimestamp(int parameterIndex,
java.sql.Timestamp X)
throws java.sql.SQLException
parameterIndex
- the first parameter is 1...
x
- the parameter value
public void setAsciiStream(int parameterIndex,
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.
parameterIndex
- the first parameter is 1...
x
- the parameter value
length
- the number of bytes in the stream
public void setUnicodeStream(int parameterIndex,
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.
parameterIndex
- the first parameter is 1...
x
- the parameter value
public void setBinaryStream(int parameterIndex,
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.
parameterIndex
- the first parameter is 1...
x
- the parameter value
public void clearParameters()
throws java.sql.SQLException
public void setObject(int parameterIndex,
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 database-specific abstract data types. This is done by using a Driver-specific Java type and using a targetSqlType of java.sql.Types.OTHER
parameterIndex
- the first parameter is 1...
x
- the object containing the input parameter value
targetSqlType
- The SQL type to be send to the database
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.
public void setObject(int parameterIndex,
java.lang.Object X,
int targetSqlType)
throws java.sql.SQLException
public void setObject(int parameterIndex,
java.lang.Object X)
throws java.sql.SQLException
public boolean execute()
throws java.sql.SQLException
| Overview | Package | Class | Tree | Deprecated | Index | Help | |||
| PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||