⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 brokeredpreparedstatement.java

📁 derby database source code.good for you.
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
/*   Derby - Class org.apache.derby.iapi.jdbc.BrokeredPreparedStatement   Copyright 2003, 2004 The Apache Software Foundation or its licensors, as applicable.   Licensed under the Apache License, Version 2.0 (the "License");   you may not use this file except in compliance with the License.   You may obtain a copy of the License at      http://www.apache.org/licenses/LICENSE-2.0   Unless required by applicable law or agreed to in writing, software   distributed under the License is distributed on an "AS IS" BASIS,   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   See the License for the specific language governing permissions and   limitations under the License. */package org.apache.derby.iapi.jdbc;import java.io.InputStream;import java.io.Reader;import java.util.Calendar;import java.sql.*;import java.net.URL;/**	JDBC 2 brokered PreparedStatement. Forwards calls off to a real prepared statement	obtained through the BrokeredStatementControl getRealPreparedStatement method. */public class BrokeredPreparedStatement extends BrokeredStatement	implements PreparedStatement{	/**		SQL used to create me.	*/	final String	sql;    public BrokeredPreparedStatement(BrokeredStatementControl control, int jdbcLevel, String sql) throws SQLException    {        super(control, jdbcLevel);		this.sql = sql;    }	/**     * A prepared SQL query is executed and its ResultSet is returned.     *     * @return a ResultSet that contains the data produced by the     * query; never null	 * @exception SQLException thrown on failure.     */	public final ResultSet executeQuery() throws SQLException    {        return wrapResultSet(getPreparedStatement().executeQuery());    }     /**     * Execute a SQL INSERT, UPDATE or DELETE statement. In addition,     * SQL statements that return nothing such as SQL DDL statements     * can be executed.     *     * @return either the row count for INSERT, UPDATE or DELETE; or 0     * for SQL statements that return nothing	 * @exception SQLException thrown on failure.     */	public final int executeUpdate() throws SQLException    {        return getPreparedStatement().executeUpdate();    }    /**     * Set a parameter to SQL NULL.     *     * <P><B>Note:</B> You must specify the parameter's SQL type.     *     * @param parameterIndex the first parameter is 1, the second is 2, ...     * @param sqlType SQL type code defined by java.sql.Types	 * @exception SQLException thrown on failure.     */    public final void setNull(int parameterIndex, int sqlType) throws SQLException    {        getPreparedStatement().setNull( parameterIndex, sqlType);    }     /**     * Set a parameter to SQL NULL.     *     * <P><B>Note:</B> You must specify the parameter's SQL type.     *     * @param parameterIndex the first parameter is 1, the second is 2, ...     * @param sqlType SQL type code defined by java.sql.Types	 * @exception SQLException thrown on failure.     */    public final void setNull(int parameterIndex, int sqlType, String typeName) throws SQLException    {        getPreparedStatement().setNull( parameterIndex, sqlType, typeName);    }     /**     * Set a parameter to a Java boolean value.  According to the JDBC API spec,	 * the driver converts this to a SQL BIT value when it sends it to the	 * database. But we don't have to do this, since the database engine	 * supports a boolean type.     *     * @param parameterIndex the first parameter is 1, the second is 2, ...     * @param x the parameter value	 * @exception SQLException thrown on failure.     */    public final void setBoolean(int parameterIndex, boolean x) throws SQLException    {        getPreparedStatement().setBoolean( parameterIndex, x);    }     /**     * Set a parameter to a Java byte value.  The driver converts this     * to a SQL TINYINT 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 setByte(int parameterIndex, byte x) throws SQLException    {        getPreparedStatement().setByte( parameterIndex, x);    }     /**     * Set a parameter to a Java short value.  The driver converts this     * to a SQL SMALLINT 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 setShort(int parameterIndex, short x) throws SQLException    {        getPreparedStatement().setShort( parameterIndex, x);    }     /**     * Set a parameter to a Java int value.  The driver converts this     * to a SQL INTEGER 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 setInt(int parameterIndex, int x) throws SQLException    {        getPreparedStatement().setInt( parameterIndex, x);    }     /**     * Set a parameter to a Java long value.  The driver converts this     * to a SQL BIGINT 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 setLong(int parameterIndex, long x) throws SQLException    {        getPreparedStatement().setLong( parameterIndex, x);    }     /**     * Set a parameter to a Java float value.  The driver converts this     * to a SQL FLOAT 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 setFloat(int parameterIndex, float x) throws SQLException    {        getPreparedStatement().setFloat( parameterIndex, x);    }     /**     * Set a parameter to a Java double value.  The driver converts this     * to a SQL DOUBLE 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 setDouble(int parameterIndex, double x) throws SQLException    {        getPreparedStatement().setDouble( parameterIndex, x);    }     /**     * Set a parameter to a java.math.BigDecimal value.       * The driver converts this to a SQL NUMERIC 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 setBigDecimal(int parameterIndex, java.math.BigDecimal x) throws SQLException    {        getPreparedStatement().setBigDecimal( parameterIndex, x);    }     /**     * Set a parameter to a Java String value.  The driver converts this     * to a SQL VARCHAR or LONGVARCHAR value (depending on the arguments     * size relative to the driver's limits on VARCHARs) 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 setString(int parameterIndex, String x) throws SQLException    {        getPreparedStatement().setString( parameterIndex, x);    }     /**     * Set a parameter to a Java array of bytes.  The driver converts     * this to a SQL VARBINARY or LONGVARBINARY (depending on the     * argument's size relative to the driver's limits on VARBINARYs)     * 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 setBytes(int parameterIndex, byte[] x) throws SQLException    {        getPreparedStatement().setBytes( parameterIndex, x);    }     /**     * 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 thrown on failure.     */    public final void setDate(int parameterIndex, Date x) throws SQLException    {        getPreparedStatement().setDate( parameterIndex, x);    }     /**     * 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 thrown on failure.     */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -