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

📄 jdbcconnection.java

📁 hsqldb是100%java实现的数据库,是一个开放源代码的JAVA数据库 l 具有标准的SQL语法和JAVA接口 l HSQLDB可以自由使用和分发 l 非常简洁和快速的
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
     * <!-- start release-specific documentation -->     * <div class="ReleaseSpecificDocumentation">     * <h3>HSQLDB-Specific Information:</h3> <p>     *     * Before HSQLDB 1.7.2, <code>SQLWarning</code> was not     * supported, and calls to this method are simply ignored. <p>     *     * Starting with HSQLDB 1.7.2, the standard behaviour is implemented. <p>     *     * </div> <!-- end release-specific documentation -->     *     * @exception SQLException if a database access error occurs <p>     */    public synchronized void clearWarnings() throws SQLException {        checkClosed();        synchronized (rootWarning_mutex) {            rootWarning = null;        }    }    //--------------------------JDBC 2.0-----------------------------    /**     * <!-- start generic documentation -->     * Creates a <code>Statement</code> object that will generate     * <code>ResultSet</code> objects with the given type and     * concurrency. This method is the same as the     * <code>createStatement</code> method above, but it allows the     * default result set type and result set concurrency type to be     * overridden. <p>     *     * <!-- end generic documentation -->     * <!-- start release-specific documentation -->     * <div class="ReleaseSpecificDocumentation">     * <h3>HSQLDB-Specific Information:</h3> <p>     *     * Up to HSQLDB 1.6.1, support was provided only for type     * <code>TYPE_FORWARD_ONLY</code>     * and concurrency <code>CONCUR_READ_ONLY</code>. <p>     *     * Starting with HSQLDB 1.7.0, support is now provided for types     * <code>TYPE_FORWARD_ONLY</code>, <I>and</I>     * <code>TYPE_SCROLL_INSENSITIVE</code>,     * with concurrency <code>CONCUR_READ_ONLY</code>.     *     * Starting with HSQLDB 1.7.2, the behaviour regarding the type and     * concurrency values has changed to more closely conform to the     * specification.  That is, if an unsupported combination is requested,     * a SQLWarning is issued on this Connection and the closest supported     * combination is used instead. <p>     *     * <B>Notes:</B> <p>     *     * Up to 1.6.1, calling this method returned <code>null</code> if the     * connection was already closed and a supported combination of type and     * concurrency was specified. This was possibly counter-intuitive     * to the expectation that an exception would be thrown for     * closed connections. Starting with 1.7.0. the behaviour is to throw a     * <code>SQLException</code> if the connection is closed.<p>     *     * </div> <!-- end release-specific documentation -->     *     * @param type a result set type; one of     *  <code>ResultSet.TYPE_FORWARD_ONLY</code>,     *  <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or     *  <code>ResultSet.TYPE_SCROLL_SENSITIVE</code> (not     *  supported)     * @param concurrency a concurrency type; one of     *  <code>ResultSet.CONCUR_READ_ONLY</code>     *  or <code>ResultSet.CONCUR_UPDATABLE</code> (not supported)     * @return a new <code>Statement</code> object that will, within     *  the release-specific documented limitations of support,     *  generate <code>ResultSet</code> objects with the given     *  type and concurrency     * @exception SQLException if a database access error occurs or     *  the given parameters are not ResultSet constants     *  indicating a supported type and concurrency     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview     *  for jdbcConnection)     */    public synchronized Statement createStatement(int type,            int concurrency) throws SQLException {        checkClosed();        type        = xlateRSType(type);        concurrency = xlateRSConcurrency(concurrency);        return new jdbcStatement(this, type);    }    /**     * <!-- start generic documentation -->     * Creates a <code>PreparedStatement</code>  object that will     * generate <code>ResultSet</code> objects with the given type     * and concurrency. This method is the same as the     * <code>prepareStatement</code> method above, but it allows the     * default result set type and result set concurrency type to be     * overridden. <p>     *     * <!-- end generic documentation -->     * <!-- start release-specific documentation -->     * <div class="ReleaseSpecificDocumentation">     * <h3>HSQLDB-Specific Information:</h3> <p>     *     * Starting with HSQLDB 1.7.2, the behaviour regarding the type and     * concurrency values has changed to more closely conform to the     * specification.  That is, if an unsupported combination is requested,     * a SQLWarning is issued on this Connection and the closest supported     * combination is used instead. <p>     *     * Also starting with 1.7.2, the support for and behaviour of     * PreparedStatment has changed.  Please read the introductory section     * of the documentation for org.hsqldb.jdbc.jdbcPreparedStatement.     *     * </div> <!-- end release-specific documentation -->     *     * @param sql a String object that is the SQL statement to be     *  sent to the database; may contain one or more ? IN     *  parameters     * @param type a result set type; one of     *  <code>ResultSet.TYPE_FORWARD_ONLY</code>,     *  <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or     *  <code>ResultSet.TYPE_SCROLL_SENSITIVE</code> (not     *  supported)     * @param concurrency a concurrency type; one of     *  <code>ResultSet.CONCUR_READ_ONLY</code>     *  or <code>ResultSet.CONCUR_UPDATABLE</code> (not supported)     * @return a new PreparedStatement object containing the     *  pre-compiled SQL statement that will produce     *  <code>ResultSet</code>     *  objects with the given type and concurrency     * @exception SQLException if a database access error occurs or     *  the given parameters are not ResultSet constants     *  indicating a supported type and concurrency     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview     *  for jdbcConnection)     */    public synchronized PreparedStatement prepareStatement(String sql,            int type, int concurrency) throws SQLException {        checkClosed();        type        = xlateRSType(type);        concurrency = xlateRSConcurrency(concurrency);        try {            return new jdbcPreparedStatement(this, sql, type);        } catch (HsqlException e) {            throw Util.sqlException(e);        }    }    /**     * <!-- start generic documentation -->     * Creates a <code>CallableStatement</code>     * object that will generate <code>ResultSet</code> objects with     * the given type and concurrency. This method is the same as the     * <code>prepareCall</code> method above, but it allows the     * default result set type and result set concurrency type to be     * overridden. <p>     *     * <!-- end generic documentation -->     * <!-- start release-specific documentation -->     * <div class="ReleaseSpecificDocumentation">     * <h3>HSQLDB-Specific Information:</h3> <p>     *     * Starting with HSQLDB 1.7.2, the behaviour regarding the type,     * concurrency and holdability values has changed to more closely     * conform to the specification.  That is, if an unsupported     * combination is requrested, a SQLWarning is issued on this Connection     * and the closest supported combination is used instead. <p>     *     * Also starting with 1.7.2, the support for and behaviour of     * CallableStatement has changed.  Please read the introdutory section     * of the documentation for org.hsqldb.jdbc.jdbcCallableStatement.     *     * </div> <!-- end release-specific documentation -->     *     * @param sql a String object that is the SQL statement to be     * sent to the database; may contain one or more ? parameters     * @param resultSetType a result set type; one of     * <code>ResultSet.TYPE_FORWARD_ONLY</code>,     * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, (not     * supported) or <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>     * (not supported)     * @param resultSetConcurrency a concurrency type; one of     * <code>ResultSet.CONCUR_READ_ONLY</code>     * or <code>ResultSet.CONCUR_UPDATABLE</code> (not supported)     * @return a new CallableStatement object containing the     * pre-compiled SQL statement     * @exception SQLException if a database access error occurs or     * the given parameters are not <code>ResultSet</code>     * constants indicating a supported type and concurrency     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview     * for jdbcConnection)     */    public synchronized CallableStatement prepareCall(String sql,            int resultSetType, int resultSetConcurrency) throws SQLException {        checkClosed();        resultSetType        = xlateRSType(resultSetType);        resultSetConcurrency = xlateRSConcurrency(resultSetConcurrency);        try {            return new jdbcCallableStatement(this, sql, resultSetType);        } catch (HsqlException e) {            throw Util.sqlException(e);        }    }    /**     * <!-- start generic documentation -->     * Gets the type map object associated with this connection. Unless     * the application has added an entry to the type map, the map     * returned will be empty.<p>     *     * <!-- end generic documentation -->     * <!-- start release-specific documentation -->     * <div class="ReleaseSpecificDocumentation">     * <h3>HSQLDB-Specific Information:</h3> <p>     *     * HSQLDB 1.7.2 does not support this feature. Calling this     * method always throws a <code>SQLException</code>, stating that the     * function is not supported. <p>     *     * </div> <!-- end release-specific documentation -->     *     * @return the <code>java.util.Map</code> object associated with     *     this <code>Connection</code> object     * @exception SQLException if a database access error occurs     *     (always, up to HSQLDB 1.7.0, inclusive)     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview     *     for jdbcConnection)     */    public synchronized Map getTypeMap() throws SQLException {        checkClosed();        throw Util.notSupported();    }    /**     * <!-- start generic documentation -->     * Installs the given <code>TypeMap</code>     * object as the type map for this <code>Connection</code>     * object. The type map will be used for the custom mapping of     * SQL structured types and distinct types.<p>     *     * <!-- end generic documentation -->     * <!-- start release-specific documentation -->     * <div class="ReleaseSpecificDocumentation">     * <h3>HSQLDB-Specific Information:</h3> <p>     *     * HSQLDB 1.7.2 does not support this feature. Calling this     * method always throws a <code>SQLException</code>, stating that     * the function is not supported. <p>     *     * </div> <!-- end release-specific documentation -->     *     * @param map the <code>java.util.Map</code> object to install as     *     the replacement for this <code>Connection</code> object's     *     default type map     * @exception SQLException if a database access error occurs or     *     the given parameter is not a <code>java.util.Map</code>     *     object (always, up to HSQLDB 1.7.0, inclusive)     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview     *     for jdbcConnection)     * @see #getTypeMap     */    public synchronized void setTypeMap(Map map) throws SQLException {        checkClosed();        throw Util.notSupported();    }// boucherb@users 20020409 - javadocs for all JDBC 3 methods// boucherb@users 20020509 - todo// start adding implementations where it is easy:  Savepoints    //--------------------------JDBC 3.0-----------------------------    /**     * <!-- start generic documentation -->     * Changes the holdability of     * <code>ResultSet</code> objects created using this     * <code>Connection</code> object to the given holdability. <p>     *     * <!-- end generic documentation -->     * <!-- start release-specific documentation -->     * <div class="ReleaseSpecificDocumentation">     * <h3>HSQLDB-Specific Information:</h3> <p>     *     * Starting with HSQLDB 1.7.2, this feature is supported. <p>     *     * As of 1.7.2, only HOLD_CURSORS_OVER_COMMIT is supported; supplying     * any other value will throw an exception. <p>     *     * </div> <!-- end release-specific documentation -->     *     * @param holdability a <code>ResultSet</code> holdability     *     constant; one of <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code>     *     or <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>     * @throws SQLException if a database access occurs, the given     *     parameter is not a <code>ResultSet</code> constant     *     indicating holdability, or the given holdability is not     *     supported     * @see #getHoldability     * @see ResultSet     * @since JDK 1.4, HSQLDB 1.7.2     *///#ifdef JDBC3    public synchronized void setHoldability(int holdability)    throws SQLException {        checkClosed();        switch (holdability) {            case jdbcResultSet.HOLD_CURSORS_OVER_COMMIT :                break;            case jdbcResultSet.CLOSE_CURSORS_AT_COMMIT :                String msg = "ResultSet holdability: " + holdability;    //NOI18N                throw Util.sqlException(Trace.FUNCTION_NOT_SUPPORTED, msg);            defa

⌨️ 快捷键说明

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