📄 brokeredpreparedstatement.java
字号:
public final void setTime(int parameterIndex, Time x) throws SQLException { getPreparedStatement().setTime( parameterIndex, x); } /** * 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 thrown on failure. */ public final void setTimestamp(int parameterIndex, Timestamp x) throws SQLException { getPreparedStatement().setTimestamp( parameterIndex, x); } /** * We do this inefficiently and read it all in here. The target type * is assumed to be a String. * * @param parameterIndex the first parameter is 1, the second is 2, ... * @param x the java input stream which contains the ASCII parameter value * @param length the number of bytes in the stream * @exception SQLException thrown on failure. */ public final void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException { getPreparedStatement().setAsciiStream( parameterIndex, x, length); } /** * We do this inefficiently and read it all in here. The target type * is assumed to be a String. The unicode source is assumed to be * in char[]. RESOLVE: might it be in UTF, instead? that'd be faster! * * @param parameterIndex the first parameter is 1, the second is 2, ... * @param x the java input stream which contains the * UNICODE parameter value * @param length the number of bytes in the stream * @exception SQLException thrown on failure. */ public final void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException { getPreparedStatement().setUnicodeStream( parameterIndex, x, length); } /** * @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 thrown on failure. */ public final void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException { getPreparedStatement().setBinaryStream( parameterIndex, x, length); } /** * JDBC 2.0 * * Add a set of parameters to the batch. * * @exception SQLException if a database-access error occurs. */ public final void addBatch() throws SQLException { getPreparedStatement().addBatch( ); } /** * <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 thrown on failure. */ public final void clearParameters() throws SQLException { getPreparedStatement().clearParameters( ); } /** * JDBC 2.0 * * 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 Feature not implemented for now. */ public final java.sql.ResultSetMetaData getMetaData() throws SQLException { return getPreparedStatement().getMetaData(); } /** * The interface says that the type of the Object parameter must * be compatible with the type of the targetSqlType. We check that, * and if it flies, we expect the underlying engine to do the * required conversion once we pass in the value using its type. * So, an Integer converting to a CHAR is done via setInteger() * support on the underlying CHAR type. * * <p>If x is null, it won't tell us its type, so we pass it on to setNull * * @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 thrown on failure. */ public final void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException { getPreparedStatement().setObject( parameterIndex, x, targetSqlType, scale); } /** * This method is like setObject above, but assumes a scale of zero. * @exception SQLException thrown on failure. */ public final void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException { getPreparedStatement().setObject( parameterIndex, x, targetSqlType); } /** * <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. * * @param parameterIndex The first parameter is 1, the second is 2, ... * @param x The object containing the input parameter value * @exception SQLException thrown on failure. */ public final void setObject(int parameterIndex, Object x) throws SQLException { getPreparedStatement().setObject( parameterIndex, x); } /** * @see java.sql.Statement#execute * @exception SQLException thrown on failure. */ public final boolean execute() throws SQLException { return getPreparedStatement().execute(); } public final void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException { getPreparedStatement().setCharacterStream( parameterIndex, reader, length); } public final void setRef(int i, Ref x) throws SQLException { getPreparedStatement().setRef( i, x); } public final void setBlob(int i, Blob x) throws SQLException { getPreparedStatement().setBlob( i, x); } public final void setClob(int i, Clob x) throws SQLException { getPreparedStatement().setClob( i, x); } public final void setArray(int i, Array x) throws SQLException { getPreparedStatement().setArray( i, x); } public final void setDate(int i, Date x, Calendar cal) throws SQLException { getPreparedStatement().setDate( i, x, cal); } public final void setTime(int i, Time x, Calendar cal) throws SQLException { getPreparedStatement().setTime( i, x, cal); } public final void setTimestamp(int i, Timestamp x, Calendar cal) throws SQLException { getPreparedStatement().setTimestamp( i, x, cal); } /* ** Control methods. */ /** * Access the underlying PreparedStatement. This method * is package protected to restrict access to the underlying * object to the brokered objects. Allowing the application to * access the underlying object thtough a public method would * */ PreparedStatement getPreparedStatement() throws SQLException { return control.getRealPreparedStatement(); } /** Override the BrokeredStatement's getStatement() to always return a PreparedStatement. */ public final Statement getStatement() throws SQLException { return getPreparedStatement(); } /** Create a duplicate PreparedStatement to this, including state, from the passed in Connection. */ public PreparedStatement createDuplicateStatement(Connection conn, PreparedStatement oldStatement) throws SQLException { PreparedStatement newStatement = conn.prepareStatement(sql, resultSetType, resultSetConcurrency); setStatementState(oldStatement, newStatement); return newStatement; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -