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

📄 jdbcpreparedstatement.java

📁 一个用java写的开源的数据库系统
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
     * @param reader the <code>java.io.Reader</code> object that contains the     * Unicode data     * @param length the number of characters in the stream     * @exception SQLException if a database access error occurs     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for     * jdbcPreparedStatement)     */// fredt@users 20020429 - patch 1.7.0 - method defined// fredt@users 20020627 - patch 574234 by ohioedge@users    public void setCharacterStream(int parameterIndex, java.io.Reader reader,                                   int length) throws SQLException {        char[] buffer = new char[length];        try {            int result = reader.read(buffer);            if (result == -1) {                throw new IOException();            }        } catch (IOException e) {            throw Trace.error(Trace.TRANSFER_CORRUPTED);        }        setString(parameterIndex, new String(buffer));    }    /**     * <!-- start generic documentation -->     * Sets the designated parameter to the given     * <code>REF(&lt;structured-type&gt;)</code> value.     * The driver converts this to an SQL <code>REF</code> value when it     * sends it to the database. <p>     * <!-- end generic documentation -->     *     * <!-- start release-specific documentation -->     * <span class="ReleaseSpecificDocumentation">     * <B>HSQLDB-Specific Information:</B> <p>     *     * HSQLDB 1.7.1 does not support this feature. <p>     *     * Calling this method always throws a <CODE>SQLException</CODE>,     * stating that the function is not supported. <p>     * </span>     * <!-- end release-specific documentation -->     *     * @param i the first parameter is 1, the second is 2, ...     * @param x an SQL <code>REF</code> value     * @exception SQLException if a database access error occurs     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for     * jdbcPreparedStatement)     */    public void setRef(int i, Ref x) throws SQLException {        throw getNotSupported();    }    /**     * <!-- start generic documentation -->     * Sets the designated parameter to the given <code>Blob</code> object.     * The driver converts this to an SQL <code>BLOB</code> value when it     * sends it to the database. <p>     * <!-- end generic documentation -->     *     * <!-- start release-specific documentation -->     * <span class="ReleaseSpecificDocumentation">     * <B>HSQLDB-Specific Information:</B> <p>     *     * HSQLDB 1.7.1 does not support this feature. <p>     *     * Calling this method always throws a <CODE>SQLException</CODE>,     * stating that the function is not supported. <p>     *     * </span>     * <!-- end release-specific documentation -->     *     * @param i the first parameter is 1, the second is 2, ...     * @param x a <code>Blob</code> object that maps an SQL <code>BLOB</code>     *     value     * @exception SQLException if a database access error occurs     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for     * jdbcPreparedStatement)     */    public void setBlob(int i, Blob x) throws SQLException {        throw getNotSupported();    }    /**     * <!-- start generic documentation -->     * Sets the designated parameter to the given <code>Clob</code> object.     * The driver converts this to an SQL <code>CLOB</code> value when it     * sends it to the database. <p>     * <!-- end generic documentation -->     *     * <!-- start release-specific documentation -->     * <span class="ReleaseSpecificDocumentation">     * <B>HSQLDB-Specific Information:</B> <p>     *     * HSQLDB 1.7.1 does not support this feature. <p>     *     * Calling this method always throws a <CODE>SQLException</CODE>,     * stating that the function is not supported. <p>     *     * </span>     * <!-- end release-specific documentation -->     *     * @param i the first parameter is 1, the second is 2, ...     * @param x a <code>Clob</code> object that maps an SQL <code>CLOB</code>     *      value     * @exception SQLException if a database access error occurs     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for     *  jdbcPreparedStatement)     */    public void setClob(int i, Clob x) throws SQLException {        throw getNotSupported();    }    /**     * <!-- start generic documentation -->     * Sets the designated parameter to the given <code>Array</code> object.     * The driver converts this to an SQL <code>ARRAY</code> value when it     * sends it to the database. <p>     * <!-- end generic documentation -->     *     * <!-- start release-specific documentation -->     * <span class="ReleaseSpecificDocumentation">     * <B>HSQLDB-Specific Information:</B> <p>     *     * HSQLDB 1.7.1 does not support this feature. <p>     *     * Calling this method always throws a <CODE>SQLException</CODE>,     * stating that the function is not supported. <p>     *     * </span>     * <!-- end release-specific documentation -->     *     * @param i the first parameter is 1, the second is 2, ...     * @param x an <code>Array</code> object that maps an SQL <code>ARRAY</code>     *       value     * @exception SQLException if a database access error occurs     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for     *   jdbcPreparedStatement)     */    public void setArray(int i, Array x) throws SQLException {        throw getNotSupported();    }    /**     * <!-- start generic documentation -->     * Retrieves a <code>ResultSetMetaData</code> object that contains     * information about the columns of the <code>ResultSet</code> object     * that will be returned when this <code>PreparedStatement</code> object     * is executed.     * <P>     * Because a <code>PreparedStatement</code> object is precompiled, it is     * possible to know about the <code>ResultSet</code> object that it will     * return without having to execute it.  Consequently, it is possible     * to invoke the method <code>getMetaData</code> on a     * <code>PreparedStatement</code> object rather than waiting to execute     * it and then invoking the <code>ResultSet.getMetaData</code> method     * on the <code>ResultSet</code> object that is returned.     * <P>     * <B>NOTE:</B> Using this method may be expensive for some drivers due     * to the lack of underlying DBMS support. <p>     * <!-- end generic documentation -->     *     * <!-- start release-specific documentation -->     * <span class="ReleaseSpecificDocumentation">     * <B>HSQLDB-Specific Information:</B> <p>     *     * HSQLDB 1.7.1 does not support this feature. <p>     *     * Calling this method always throws a <CODE>SQLException</CODE>,     * stating that the function is not supported. <p>     *     * </span>     * <!-- end release-specific documentation -->     *     * @return the description of a <code>ResultSet</code> object's columns or     *    <code>null</code> if the driver cannot return a     *    <code>ResultSetMetaData</code> object     * @exception SQLException if a database access error occurs     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for     *   jdbcPreparedStatement)     */    public ResultSetMetaData getMetaData() throws SQLException {        throw getNotSupported();    }    /**     * <!-- start generic documentation -->     * Sets the designated parameter to the given <code>java.sql.Date</code>     * value, using the given <code>Calendar</code> object.  The driver uses     * the <code>Calendar</code> object to construct an SQL <code>DATE</code>     * value,which the driver then sends to the database.  With a     * a <code>Calendar</code> object, the driver can calculate the date     * taking into account a custom timezone.  If no     * <code>Calendar</code> object is specified, the driver uses the default     * timezone, which is that of the virtual machine running the     * application. <p>     * <!-- end generic documentation -->     *     * <!-- start release-specific documentation -->     * <span class="ReleaseSpecificDocumentation">     * </span>     * <!-- end release-specific documentation -->     *     * @param parameterIndex the first parameter is 1, the second is 2, ...     * @param x the parameter value     * @param cal the <code>Calendar</code> object the driver will use     *       to construct the date     * @exception SQLException if a database access error occurs     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for     *   jdbcPreparedStatement)     */// fredt@users 20020414 - patch 517028 by peterhudson@users - method defined// changes by fredt - moved conversion to HsqlDateTime    public void setDate(int parameterIndex, java.sql.Date x,                        Calendar cal) throws SQLException {        if (Trace.TRACE) {            Trace.trace();        }        if (x == null) {            setNull(parameterIndex);        } else {            String dateString = HsqlDateTime.getDateString(x, cal);            setParameter(parameterIndex, Column.createSQLString(dateString));        }    }    /**     * <!-- start generic documentation -->     * Sets the designated parameter to the given <code>java.sql.Time</code>     * value, using the given <code>Calendar</code> object.  The driver uses     * the <code>Calendar</code> object to construct an SQL <code>TIME</code>     * value, which the driver then sends to the database.  With a     * a <code>Calendar</code> object, the driver can calculate the time     * taking into account a custom timezone.  If no     * <code>Calendar</code> object is specified, the driver uses the default     * timezone, which is that of the virtual machine running the     * application. <p>     * <!-- end generic documentation -->     *     * <!-- start release-specific documentation -->     * <span class="ReleaseSpecificDocumentation">     * </span>     * <!-- end release-specific documentation -->     *     * @param parameterIndex the first parameter is 1, the second is 2, ...     * @param x the parameter value     * @param cal the <code>Calendar</code> object the driver will use     *       to construct the time     * @exception SQLException if a database access error occurs     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for     *   jdbcPreparedStatement)     */// fredt@users 20020414 - patch 517028 by peterhudson@users - method defined// changes by fredt - moved conversion to HsqlDateTime    public void setTime(int parameterIndex, java.sql.Time x,                        Calendar cal) throws SQLException {        if (Trace.TRACE) {            Trace.trace();        }        if (x == null) {            setNull(parameterIndex);        } else {            String dateString = HsqlDateTime.getTimeString(x, cal);            setParameter(parameterIndex, Column.createSQLString(dateString));        }    }    /**     * <!-- start generic documentation -->     * Sets the designated parameter to the given <code>java.sql.Timestamp</code>     * value, using the given <code>Calendar</code> object.  The driver uses     * the <code>Calendar</code> object to construct an SQL <code>TIMESTAMP</code>     * value, which the driver then sends to the database.  With a     * <code>Calendar</code> object, the driver can calculate the timestamp     * taking into account a custom timezone.  If no     * <code>Calendar</code> object is specified, the driver uses the default     * timezone, which is that of the virtual machine running the application. <p>     * <!-- end generic documentation -->     *     * <!-- start release-specific documentation -->     * <span class="ReleaseSpecificDocumentation">     * </span>     * <!-- end release-specific documentation -->     * @param parameterIndex the first parameter is 1, the second is 2, ...     * @param x the parameter value     * @param cal the <code>Calendar</code> object the driver will use     *       to construct the timestamp     * @exception SQLException if a database access error occurs     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for     *   jdbcPreparedStatement)     */// fredt@users 20020414 - patch 517028 by peterhudson@users - method defined// changes by fredt - moved conversion to HsqlDateTime    public void setTimestamp(int parameterIndex, java.sql.Timestamp x,                             Calendar cal) throws SQLException {        if (Trace.TRACE) {            Trace.trace();        }        if (x == null) {            setNull(parameterIndex);        } else {            String dateString = HsqlDateTime.getTimestampString(x, cal);            setParameter(parameterIndex, Column.createSQLString(dateString));        }    }    /**     * <!-- start generic documentation -->     * Sets the designated parameter to SQL <code>NULL</code>.     * This version of the method <code>setNull</code> should     * be used for user-defined types and REF type parameters.  Examples     * of user-defined types include: STRUCT, DISTINCT, JAVA_OBJECT, and     * named array types.     *     * <P><B>Note:</B> To be portable, applic

⌨️ 快捷键说明

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