📄 callablestatement.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Thu Apr 27 23:36:18 PDT 2000 --><TITLE>Java 2 Platform SE v1.3: Interface CallableStatement</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/CallableStatement.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Std. Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../java/sql/Blob.html"><B>PREV CLASS</B></A> <A HREF="../../java/sql/Clob.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="CallableStatement.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">java.sql</FONT><BR>Interface CallableStatement</H2><DL><DT><B>All Superinterfaces:</B> <DD><A HREF="../../java/sql/PreparedStatement.html">PreparedStatement</A>, <A HREF="../../java/sql/Statement.html">Statement</A></DD></DL><HR><DL><DT>public interface <B>CallableStatement</B><DT>extends <A HREF="../../java/sql/PreparedStatement.html">PreparedStatement</A></DL><P>The interface used to execute SQL stored procedures. JDBC provides a stored procedure SQL escape syntax that allows stored procedures to be called in a standard way for all RDBMSs. This escape syntax has one form that includes a result parameter and one that does not. If used, the result parameter must be registered as an OUT parameter. The other parameters can be used for input, output or both. Parameters are referred to sequentially, by number, with the first parameter being 1. <P> <blockquote><pre> {?= call <procedure-name>[<arg1>,<arg2>, ...]} {call <procedure-name>[<arg1>,<arg2>, ...]} </pre></blockquote> <P> IN parameter values are set using the set methods inherited from <A HREF="../../java/sql/PreparedStatement.html"><CODE>PreparedStatement</CODE></A>. The type of all OUT parameters must be registered prior to executing the stored procedure; their values are retrieved after execution via the <code>get</code> methods provided here. <P> A <code>CallableStatement</code> can return one <A HREF="../../java/sql/ResultSet.html"><CODE>ResultSet</CODE></A> or multiple <code>ResultSet</code> objects. Multiple <code>ResultSet</code> objects are handled using operations inherited from <A HREF="../../java/sql/Statement.html"><CODE>Statement</CODE></A>. <P> For maximum portability, a call's <code>ResultSet</code> objects and update counts should be processed prior to getting the values of output parameters. <P> Methods that are new in the JDBC 2.0 API are marked "Since 1.2."<P><DL><DT><B>See Also: </B><DD><A HREF="../../java/sql/Connection.html#prepareCall(java.lang.String)"><CODE>Connection.prepareCall(java.lang.String)</CODE></A>, <A HREF="../../java/sql/ResultSet.html"><CODE>ResultSet</CODE></A></DL><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><!-- ======== CONSTRUCTOR SUMMARY ======== --><!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/sql/Array.html">Array</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/sql/CallableStatement.html#getArray(int)">getArray</A></B>(int i)</CODE><BR> Gets the value of a JDBC <code>ARRAY</code> parameter as an <A HREF="../../java/sql/Array.html"><CODE>Array</CODE></A> object in the Java programming language.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/math/BigDecimal.html">BigDecimal</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/sql/CallableStatement.html#getBigDecimal(int)">getBigDecimal</A></B>(int parameterIndex)</CODE><BR> Gets the value of a JDBC <code>NUMERIC</code> parameter as a <code>java.math.BigDecimal</code> object with as many digits to the right of the decimal point as the value contains.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/math/BigDecimal.html">BigDecimal</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/sql/CallableStatement.html#getBigDecimal(int, int)">getBigDecimal</A></B>(int parameterIndex, int scale)</CODE><BR> <B>Deprecated.</B> <I></I> </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/sql/Blob.html">Blob</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/sql/CallableStatement.html#getBlob(int)">getBlob</A></B>(int i)</CODE><BR> Gets the value of a JDBC <code>BLOB</code> parameter as a <A HREF="../../java/sql/Blob.html"><CODE>Blob</CODE></A> object in the Java programming language.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/sql/CallableStatement.html#getBoolean(int)">getBoolean</A></B>(int parameterIndex)</CODE><BR> Gets the value of a JDBC <code>BIT</code> parameter as a <code>boolean</code> in the Java programming language.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> byte</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/sql/CallableStatement.html#getByte(int)">getByte</A></B>(int parameterIndex)</CODE><BR> Gets the value of a JDBC <code>TINYINT</code> parameter as a <code>byte</code> in the Java programming language.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> byte[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/sql/CallableStatement.html#getBytes(int)">getBytes</A></B>(int parameterIndex)</CODE><BR> Gets the value of a JDBC <code>BINARY</code> or <code>VARBINARY</code> parameter as an array of <code>byte</code> values in the Java programming language.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/sql/Clob.html">Clob</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/sql/CallableStatement.html#getClob(int)">getClob</A></B>(int i)</CODE><BR> Gets the value of a JDBC <code>CLOB</code> parameter as a <code>Clob</code> object in the Java programming language.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/sql/Date.html">Date</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/sql/CallableStatement.html#getDate(int)">getDate</A></B>(int parameterIndex)</CODE><BR> Gets the value of a JDBC <code>DATE</code> parameter as a <code>java.sql.Date</code> object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/sql/Date.html">Date</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/sql/CallableStatement.html#getDate(int, java.util.Calendar)">getDate</A></B>(int parameterIndex, <A HREF="../../java/util/Calendar.html">Calendar</A> cal)</CODE><BR> Gets the value of a JDBC <code>DATE</code> parameter as a <code>java.sql.Date</code> object, using the given <code>Calendar</code> object to construct the date.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> double</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/sql/CallableStatement.html#getDouble(int)">getDouble</A></B>(int parameterIndex)</CODE><BR> Gets the value of a JDBC <code>DOUBLE</code> parameter as a <code>double</code> in the Java programming language.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> float</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/sql/CallableStatement.html#getFloat(int)">getFloat</A></B>(int parameterIndex)</CODE><BR> Gets the value of a JDBC <code>FLOAT</code> parameter as a <code>float</code> in the Java programming language.</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/CallableStatement.html#getInt(int)">getInt</A></B>(int parameterIndex)</CODE><BR> Gets the value of a JDBC <code>INTEGER</code> parameter as an <code>int</code> in the Java programming language.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> long</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/sql/CallableStatement.html#getLong(int)">getLong</A></B>(int parameterIndex)</CODE><BR> Gets the value of a JDBC <code>BIGINT</code> parameter as a <code>long</code> in the Java programming language.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/lang/Object.html">Object</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/sql/CallableStatement.html#getObject(int)">getObject</A></B>(int parameterIndex)</CODE><BR> Gets the value of a parameter as an <code>Object</code> in the Java programming language.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/lang/Object.html">Object</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/sql/CallableStatement.html#getObject(int, java.util.Map)">getObject</A></B>(int i, <A HREF="../../java/util/Map.html">Map</A> map)</CODE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -