📄 preparedstatement.java
字号:
*/ void setUnicodeStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException; /** * 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. JDBC will read the data from the stream * as needed, until it reaches end-of-file. * * <P><B>Note:</B> This stream object can either be a standard * Java stream object or your own subclass that implements the * standard interface. * * @param parameterIndex the first parameter is 1, the second is 2, ... * @param x the java input stream which contains the binary parameter value * @param length the number of bytes in the stream * @exception SQLException if a database-access error occurs. */ void setBinaryStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException; /** * <P>In general, parameter values remain in force for repeated use of a * Statement. Setting a parameter value automatically clears its * previous value. However, in some cases it is useful to immediately * release the resources used by the current parameter values; this can * be done by calling clearParameters. * * @exception SQLException if a database-access error occurs. */ void clearParameters() throws SQLException; //---------------------------------------------------------------------- // Advanced features: /** * <p>Set the value of a parameter using an object; use the * java.lang equivalent objects for integral values. * * <p>The given Java object will be converted to the targetSqlType * before being sent to the database. * * If the object is of a class implementing SQLData, * the JDBC driver should call its method writeSQL() to write it * to the SQL data stream. * else * If the object is of a class implementing Ref, Blob, Clob, Struct, * or Array then pass it to the database as a value of the * corresponding SQL type. * * <p>Note that this method may be used to pass datatabase- * specific abstract data types. * * @param parameterIndex The first parameter is 1, the second is 2, ... * @param x The object containing the input parameter value * @param targetSqlType The SQL type (as defined in java.sql.Types) to be * sent to the database. The scale argument may further qualify this type. * @param 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, * @exception SQLException if a database-access error occurs. * @see Types */ void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException; /** * This method is like setObject above, but assumes a scale of zero. * * @exception SQLException if a database-access error occurs. */ void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException; /** * <p>Set the value of a parameter using an object; use the * java.lang equivalent objects for integral values. * * <p>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. * * <p>Note that this method may be used to pass datatabase * specific abstract data types, by using a Driver specific Java * type. * * If the object is of a class implementing SQLData, * the JDBC driver should call its method writeSQL() to write it * to the SQL data stream. * else * If the object is of a class implementing Ref, Blob, Clob, Struct, * or Array then pass it to the database as a value of the * corresponding SQL type. * * Raise an exception if there is an ambiguity, for example, if the * object is of a class implementing more than one of those interfaces. * * @param parameterIndex The first parameter is 1, the second is 2, ... * @param x The object containing the input parameter value * @exception SQLException if a database-access error occurs. */ void setObject(int parameterIndex, Object x) throws SQLException; /** * 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. * * @exception SQLException if a database-access error occurs. * @see Statement#execute */ boolean execute() throws SQLException; //--------------------------JDBC 2.0----------------------------- /** * JDBC 2.0 * * Add a set of parameters to the batch. * * @exception SQLException if a database-access error occurs. * @see Statement#addBatch */ void addBatch() throws SQLException; /** * JDBC 2.0 * * When a very large UNICODE value is input to a LONGVARCHAR * parameter, it may be more practical to send it via a * java.io.Reader. JDBC will read the data from the stream * as needed, until it reaches end-of-file. The JDBC driver will * do any necessary conversion from UNICODE to the database char format. * * <P><B>Note:</B> This stream object can either be a standard * Java stream object or your own subclass that implements the * standard interface. * * @param parameterIndex the first parameter is 1, the second is 2, ... * @param x the java reader which contains the UNICODE data * @param length the number of characters in the stream * @exception SQLException if a database-access error occurs. */ void setCharacterStream(int parameterIndex, java.io.Reader reader, int length) throws SQLException; /** * JDBC 2.0 * * Set a REF(<structured-type>) parameter. * * @param i the first parameter is 1, the second is 2, ... * @param x an object representing data of an SQL REF Type */ void setRef (int i, Ref x) throws SQLException; /** * JDBC 2.0 * * Set a BLOB parameter. * * @param i the first parameter is 1, the second is 2, ... * @param x an object representing a BLOB */ void setBlob (int i, Blob x) throws SQLException; /** * JDBC 2.0 * * Set a CLOB parameter. * * @param i the first parameter is 1, the second is 2, ... * @param x an object representing a CLOB */ void setClob (int i, Clob x) throws SQLException; /** * JDBC 2.0 * * Set an Array parameter. * * @param i the first parameter is 1, the second is 2, ... * @param x an object representing an SQL array */ void setArray (int i, Array x) throws SQLException; /** * The number, types and properties of a ResultSet's columns * are provided by the getMetaData method. * * @return the description of a ResultSet's columns * @exception SQLException if a database-access error occurs. */ ResultSetMetaData getMetaData() throws SQLException; /** * Set a parameter to a java.sql.Date value. The driver converts this * to a SQL DATE value when it sends it to the database. * * @param parameterIndex the first parameter is 1, the second is 2, ... * @param x the parameter value * @exception SQLException if a database-access error occurs. */ void setDate(int parameterIndex, java.sql.Date x, Calendar cal) throws SQLException; /** * Set a parameter to a java.sql.Time value. The driver converts this * to a SQL TIME value when it sends it to the database. * * @param parameterIndex the first parameter is 1, the second is 2, ... * @param x the parameter value * @exception SQLException if a database-access error occurs. */ void setTime(int parameterIndex, java.sql.Time x, Calendar cal) throws SQLException; /** * Set a parameter to a java.sql.Timestamp value. The driver * converts this to a SQL TIMESTAMP value when it sends it to the * database. * * @param parameterIndex the first parameter is 1, the second is 2, ... * @param x the parameter value * @exception SQLException if a database-access error occurs. */ void setTimestamp(int parameterIndex, java.sql.Timestamp x, Calendar cal) throws SQLException;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -