📄 jdbcstatement.java
字号:
* <b>HSQLDB-Specific Information:</b> <p> * * Up to and including 1.7.1, HSQLDB supports only * <code>CONCUR_READ_ONLY</code> concurrency. <p> * * </span> * <!-- end release-specific documentation --> * * @return either <code>ResultSet.CONCUR_READ_ONLY</code> or * <code>ResultSet.CONCUR_UPDATABLE</code> (not supported) * @exception SQLException if a database access error occurs * @since JDK 1.2 (JDK 1.1.x developers: read the new overview * for jdbcStatement) */ public int getResultSetConcurrency() throws SQLException { if (Trace.TRACE) { Trace.trace(); } checkClosed(); return jdbcResultSet.CONCUR_READ_ONLY; } /** * <!-- start generic documentation --> * Retrieves the result set type for <code>ResultSet</code> objects * generated by this <code>Statement</code> object. <p> * <!-- end generic documentation --> * * <!-- start release-specific documentation --> * <span class="ReleaseSpecificDocumentation"> * <b>HSQLDB-Specific Information:</b> <p> * * Up to 1.6.1, HSQLDB supported <code>TYPE_FORWARD_ONLY</code> - * <code>CONCUR_READ_ONLY</code> results only, so <code>ResultSet</code> * objects created using the returned <code>Statement</code> * object would <I>always</I> be type <code>TYPE_FORWARD_ONLY</code> * with <code>CONCUR_READ_ONLY</code> concurrency. <p> * * Starting with 1.7.0, HSQLDB also supports * <code>TYPE_SCROLL_INSENSITIVE</code> results.<p> * * </span> * <!-- end release-specific documentation --> * * @return one of <code>ResultSet.TYPE_FORWARD_ONLY</code>, * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code> (not supported) <p> * * <b>Note:</b> Up to and including 1.7.1, HSQLDB never returns * <code>TYPE_SCROLL_SENSITIVE</code> * @exception SQLException if a database access error occurs * @since JDK 1.2 (JDK 1.1.x developers: read the new overview * for jdbcStatement) */ public int getResultSetType() throws SQLException { if (Trace.TRACE) { Trace.trace(); } checkClosed(); return rsType; } /** * <!-- start generic documentation --> * Adds the given SQL command to the current list of commmands for this * <code>Statement</code> object. The commands in this list can be * executed as a batch by calling the method <code>executeBatch</code>. * <P> * <B>NOTE:</B> This method is optional. <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 sql typically this is a static SQL <code>INSERT</code> or * <code>UPDATE</code> statement * @exception SQLException if a database access error occurs, or the * driver does not support batch updates * @see #executeBatch * @since JDK 1.2 (JDK 1.1.x developers: read the new overview * for jdbcStatement) */ public void addBatch(String sql) throws SQLException { if (Trace.TRACE) { Trace.trace(); } throw Trace.error(Trace.FUNCTION_NOT_SUPPORTED); } /** * <!-- start generic documentation --> * Empties this <code>Statement</code> object's current list of * SQL commands. * <P> * <B>NOTE:</B> This method is optional. <p> * <!-- start 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 --> * * @exception SQLException if a database access error occurs or the * driver does not support batch updates * @see #addBatch * @since JDK 1.2 (JDK 1.1.x developers: read the new overview * for jdbcStatement) */ public void clearBatch() throws SQLException { if (Trace.TRACE) { Trace.trace(); } throw Trace.error(Trace.FUNCTION_NOT_SUPPORTED); } /** * <!-- start generic documentation --> * Submits a batch of commands to the database for execution and * if all commands execute successfully, returns an array of update counts. * The <code>int</code> elements of the array that is returned are ordered * to correspond to the commands in the batch, which are ordered * according to the order in which they were added to the batch. * The elements in the array returned by the method <code>executeBatch</code> * may be one of the following: * <OL> * <LI>A number greater than or equal to zero -- indicates that the * command was processed successfully and is an update count giving the * number of rows in the database that were affected by the command's * execution * <LI>A value of <code>SUCCESS_NO_INFO</code> -- indicates that the command was * processed successfully but that the number of rows affected is * unknown * <P> * If one of the commands in a batch update fails to execute properly, * this method throws a <code>BatchUpdateException</code>, and a JDBC * driver may or may not continue to process the remaining commands in * the batch. However, the driver's behavior must be consistent with a * particular DBMS, either always continuing to process commands or never * continuing to process commands. If the driver continues processing * after a failure, the array returned by the method * <code>BatchUpdateException.getUpdateCounts</code> * will contain as many elements as there are commands in the batch, and * at least one of the elements will be the following: * <P> * <LI>A value of <code>EXECUTE_FAILED</code> -- indicates that the command failed * to execute successfully and occurs only if a driver continues to * process commands after a command fails * </OL> * <P> * A driver is not required to implement this method. * The possible implementations and return values have been modified in * the Java 2 SDK, Standard Edition, version 1.3 to * accommodate the option of continuing to proccess commands in a batch * update after a <code>BatchUpdateException</code> obejct has been thrown. <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 an array of update counts containing one element for each * command in the batch. The elements of the array are ordered according * to the order in which commands were added to the batch. * @exception SQLException if a database access error occurs or the * driver does not support batch statements. Throws * {@link java.sql.BatchUpdateException} * (a subclass of <code>java.sql.SQLException</code>) if one of the commands * sent to the database fails to execute properly or attempts to return a * result set. * @since JDK 1.3 (JDK 1.1.x developers: read the new overview * for jdbcStatement) */ public int[] executeBatch() throws SQLException { if (Trace.TRACE) { Trace.trace(); } checkClosed(); throw Trace.error(Trace.FUNCTION_NOT_SUPPORTED); } /** * <!-- start generic documentation --> * Retrieves the <code>Connection</code> object * that produced this <code>Statement</code> object. <p> * <!-- end generic documentation --> * * <!-- start release-specific documentation --> * <span class="ReleaseSpecificDocumentation"> * </span> * <!-- end release-specific documentation --> * @return the connection that produced this statement * @exception SQLException if a database access error occurs * @since JDK 1.2 (JDK 1.1.x developers: read the new overview * for jdbcStatement) */ public Connection getConnection() throws SQLException { checkClosed(); if (Trace.TRACE) { Trace.trace(); } return cConnection; } //--------------------------JDBC 3.0----------------------------- /** * <!-- start generic documentation --> * Moves to this <code>Statement</code> object's next result, deals with * any current <code>ResultSet</code> object(s) according to the instructions * specified by the given flag, and returns * <code>true</code> if the next result is a <code>ResultSet</code> object. * * <P>There are no more results when the following is true: * <PRE> * <code>(!getMoreResults() && (getUpdateCount() == -1)</code> * </PRE> <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 current one of the following <code>Statement</code> * constants indicating what should happen to current * <code>ResultSet</code> objects obtained using the method * <code>getResultSet</code: * <code>CLOSE_CURRENT_RESULT</code>, * <code>KEEP_CURRENT_RESULT</code>, or * <code>CLOSE_ALL_RESULTS</code> * @return <code>true</code> if the next result is a <code>ResultSet</code> * object; <code>false</code> if it is an update count or there are no * more results * @exception SQLException if a database access error occurs * @since JDK 1.4, HSQLDB 1.7 * @see #execute *///#ifdef JDBC3/* public boolean getMoreResults(int current) throws SQLException { throw Trace.error(Trace.FUNCTION_NOT_SUPPORTED, "JDBC3"); }*///#endif JDBC3 /** * <!-- start generic documentation --> * Retrieves any auto-generated keys created as a result of executing this * <code>Statement</code> object. If this <code>Statement</code> object did * not generate any keys, an empty <code>ResultSet</code> * object is returned. <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 a <code>ResultSet</code> object containing the auto-generated key(s) * generated by the execution of this <code>Statement</code> object * @exception SQLException if a database access error occurs * @since JDK 1.4, HSQLDB 1.7 *///#ifdef JDBC3/* public ResultSet getGeneratedKeys() throws SQLException { throw Trace.error(Trace.FUNCTION_NOT_SUPPORTED, "JDBC3"); }*///#endif JDBC3 /** * <!-- start generic documentation --> * Executes the given SQL statement and signals the driver with the * given flag about whether the * auto-generated keys produced by this <code>Statement</code> object * should be made available for retrieval. <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>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -