📄 statement.html
字号:
<BR> Retrieves the number of seconds the driver will wait for a <code>Statement</code> object to execute.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/sql/ResultSet.html">ResultSet</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/sql/Statement.html#getResultSet()">getResultSet</A></B>()</CODE><BR> Returns the current result as a <code>ResultSet</code> object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/sql/Statement.html#getResultSetConcurrency()">getResultSetConcurrency</A></B>()</CODE><BR> Retrieves the result set concurrency for <code>ResultSet</code> objects generated by this <code>Statement</code> object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/sql/Statement.html#getResultSetType()">getResultSetType</A></B>()</CODE><BR> Retrieves the result set type for <code>ResultSet</code> objects generated by this <code>Statement</code> object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/sql/Statement.html#getUpdateCount()">getUpdateCount</A></B>()</CODE><BR> Returns the current result as an update count; if the result is a <code>ResultSet</code> object or there are no more results, -1 is returned.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/sql/SQLWarning.html">SQLWarning</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/sql/Statement.html#getWarnings()">getWarnings</A></B>()</CODE><BR> Retrieves the first warning reported by calls on this <code>Statement</code> object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/sql/Statement.html#setCursorName(java.lang.String)">setCursorName</A></B>(<A HREF="../../java/lang/String.html">String</A> name)</CODE><BR> Defines the SQL cursor name that will be used by subsequent <code>Statement</code> object <code>execute</code> methods.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/sql/Statement.html#setEscapeProcessing(boolean)">setEscapeProcessing</A></B>(boolean enable)</CODE><BR> Sets escape processing on or off.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/sql/Statement.html#setFetchDirection(int)">setFetchDirection</A></B>(int direction)</CODE><BR> Gives the driver a hint as to the direction in which the rows in a result set will be processed.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/sql/Statement.html#setFetchSize(int)">setFetchSize</A></B>(int rows)</CODE><BR> Gives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/sql/Statement.html#setMaxFieldSize(int)">setMaxFieldSize</A></B>(int max)</CODE><BR> Sets the limit for the maximum number of bytes in a column to the given number of bytes.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/sql/Statement.html#setMaxRows(int)">setMaxRows</A></B>(int max)</CODE><BR> Sets the limit for the maximum number of rows that any <code>ResultSet</code> object can contain to the given number.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/sql/Statement.html#setQueryTimeout(int)">setQueryTimeout</A></B>(int seconds)</CODE><BR> Sets the number of seconds the driver will wait for a <code>Statement</code> object to execute to the given number of seconds.</TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="executeQuery(java.lang.String)"><!-- --></A><H3>executeQuery</H3><PRE>public <A HREF="../../java/sql/ResultSet.html">ResultSet</A> <B>executeQuery</B>(<A HREF="../../java/lang/String.html">String</A> sql) throws <A HREF="../../java/sql/SQLException.html">SQLException</A></PRE><DL><DD>Executes an SQL statement that returns a single <code>ResultSet</code> object.<DD><DL><DT><B>Parameters:</B><DD><CODE>sql</CODE> - typically this is a static SQL <code>SELECT</code> statement<DT><B>Returns:</B><DD>a <code>ResultSet</code> object that contains the data produced by the given query; never <code>null</code><DT><B>Throws:</B><DD><CODE><A HREF="../../java/sql/SQLException.html">SQLException</A></CODE> - if a database access error occurs</DL></DD></DL><HR><A NAME="executeUpdate(java.lang.String)"><!-- --></A><H3>executeUpdate</H3><PRE>public int <B>executeUpdate</B>(<A HREF="../../java/lang/String.html">String</A> sql) throws <A HREF="../../java/sql/SQLException.html">SQLException</A></PRE><DL><DD>Executes an SQL <code>INSERT</code>, <code>UPDATE</code> or <code>DELETE</code> statement. In addition, SQL statements that return nothing, such as SQL DDL statements, can be executed.<DD><DL><DT><B>Parameters:</B><DD><CODE>sql</CODE> - an SQL <code>INSERT</code>, <code>UPDATE</code> or <code>DELETE</code> statement or an SQL statement that returns nothing<DT><B>Returns:</B><DD>either the row count for <code>INSERT</code>, <code>UPDATE</code> or <code>DELETE</code> statements, or 0 for SQL statements that return nothing<DT><B>Throws:</B><DD><CODE><A HREF="../../java/sql/SQLException.html">SQLException</A></CODE> - if a database access error occurs</DL></DD></DL><HR><A NAME="close()"><!-- --></A><H3>close</H3><PRE>public void <B>close</B>() throws <A HREF="../../java/sql/SQLException.html">SQLException</A></PRE><DL><DD>Releases this <code>Statement</code> object's database and JDBC resources immediately instead of waiting for this to happen when it is automatically closed. It is generally good practice to release resources as soon as you are finished with them to avoid tying up database resources. <P><B>Note:</B> A <code>Statement</code> object is automatically closed when it is garbage collected. When a <code>Statement</code> object is closed, its current <code>ResultSet</code> object, if one exists, is also closed.<DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../java/sql/SQLException.html">SQLException</A></CODE> - if a database access error occurs</DL></DD></DL><HR><A NAME="getMaxFieldSize()"><!-- --></A><H3>getMaxFieldSize</H3><PRE>public int <B>getMaxFieldSize</B>() throws <A HREF="../../java/sql/SQLException.html">SQLException</A></PRE><DL><DD>Returns the maximum number of bytes allowed for any column value. This limit is the maximum number of bytes that can be returned for any column value. The limit applies only to <code>BINARY</code>, <code>VARBINARY</code>, <code>LONGVARBINARY</code>, <code>CHAR</code>, <code>VARCHAR</code>, and <code>LONGVARCHAR</code> columns. If the limit is exceeded, the excess data is silently discarded.<DD><DL><DT><B>Returns:</B><DD>the current max column size limit; zero means unlimited<DT><B>Throws:</B><DD><CODE><A HREF="../../java/sql/SQLException.html">SQLException</A></CODE> - if a database access error occurs</DL></DD></DL><HR><A NAME="setMaxFieldSize(int)"><!-- --></A><H3>setMaxFieldSize</H3><PRE>public void <B>setMaxFieldSize</B>(int max) throws <A HREF="../../java/sql/SQLException.html">SQLException</A></PRE><DL><DD>Sets the limit for the maximum number of bytes in a column to the given number of bytes. This is the maximum number of bytes that can be returned for any column value. This limit applies only to <code>BINARY</code>, <code>VARBINARY</code>, <code>LONGVARBINARY</code>, <code>CHAR</code>, <code>VARCHAR</code>, and <code>LONGVARCHAR</code> fields. If the limit is exceeded, the excess data is silently discarded. For maximum portability, use values greater than 256.<DD><DL><DT><B>Parameters:</B><DD><CODE>max</CODE> - the new max column size limit; zero means unlimited<DT><B>Throws:</B><DD><CODE><A HREF="../../java/sql/SQLException.html">SQLException</A></CODE> - if a database access error occurs</DL></DD></DL><HR><A NAME="getMaxRows()"><!-- --></A><H3>getMaxRows</H3><PRE>public int <B>getMaxRows</B>() throws <A HREF="../../java/sql/SQLException.html">SQLException</A></PRE><DL><DD>Retrieves the maximum number of rows that a <code>ResultSet</code> object can contain. If the limit is exceeded, the excess rows are silently dropped.<DD><DL><DT><B>Returns:</B><DD>the current max row limit; zero means unlimited<DT><B>Throws:</B><DD><CODE><A HREF="../../java/sql/SQLException.html">SQLException</A></CODE> - if a database access error occurs</DL></DD></DL><HR><A NAME="setMaxRows(int)"><!-- --></A><H3>setMaxRows</H3><PRE>public void <B>setMaxRows</B>(int max) throws <A HREF="../../java/sql/SQLException.html">SQLException</A></PRE><DL>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -