📄 preparedstatement.html
字号:
<DL><DD>Sets the designated parameter to SQL <code>NULL</code>. <P><B>Note:</B> You must specify the parameter's SQL type.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>parameterIndex</CODE> - the first parameter is 1, the second is 2, ...<DD><CODE>sqlType</CODE> - the SQL type code defined in <code>java.sql.Types</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="setBoolean(int, boolean)"><!-- --></A><H3>setBoolean</H3><PRE>public void <B>setBoolean</B>(int parameterIndex, boolean x) throws <A HREF="../../java/sql/SQLException.html">SQLException</A></PRE><DL><DD>Sets the designated parameter to a Java <code>boolean</code> value. The driver converts this to an SQL <code>BIT</code> value when it sends it to the database.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>parameterIndex</CODE> - the first parameter is 1, the second is 2, ...<DD><CODE>x</CODE> - the parameter value<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="setByte(int, byte)"><!-- --></A><H3>setByte</H3><PRE>public void <B>setByte</B>(int parameterIndex, byte x) throws <A HREF="../../java/sql/SQLException.html">SQLException</A></PRE><DL><DD>Sets the designated parameter to a Java <code>byte</code> value. The driver converts this to an SQL <code>TINYINT</code> value when it sends it to the database.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>parameterIndex</CODE> - the first parameter is 1, the second is 2, ...<DD><CODE>x</CODE> - the parameter value<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="setShort(int, short)"><!-- --></A><H3>setShort</H3><PRE>public void <B>setShort</B>(int parameterIndex, short x) throws <A HREF="../../java/sql/SQLException.html">SQLException</A></PRE><DL><DD>Sets the designated parameter to a Java <code>short</code> value. The driver converts this to an SQL <code>SMALLINT</code> value when it sends it to the database.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>parameterIndex</CODE> - the first parameter is 1, the second is 2, ...<DD><CODE>x</CODE> - the parameter value<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="setInt(int, int)"><!-- --></A><H3>setInt</H3><PRE>public void <B>setInt</B>(int parameterIndex, int x) throws <A HREF="../../java/sql/SQLException.html">SQLException</A></PRE><DL><DD>Sets the designated parameter to a Java <code>int</code> value. The driver converts this to an SQL <code>INTEGER</code> value when it sends it to the database.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>parameterIndex</CODE> - the first parameter is 1, the second is 2, ...<DD><CODE>x</CODE> - the parameter value<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="setLong(int, long)"><!-- --></A><H3>setLong</H3><PRE>public void <B>setLong</B>(int parameterIndex, long x) throws <A HREF="../../java/sql/SQLException.html">SQLException</A></PRE><DL><DD>Sets the designated parameter to a Java <code>long</code> value. The driver converts this to an SQL <code>BIGINT</code> value when it sends it to the database.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>parameterIndex</CODE> - the first parameter is 1, the second is 2, ...<DD><CODE>x</CODE> - the parameter value<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="setFloat(int, float)"><!-- --></A><H3>setFloat</H3><PRE>public void <B>setFloat</B>(int parameterIndex, float x) throws <A HREF="../../java/sql/SQLException.html">SQLException</A></PRE><DL><DD>Sets the designated parameter to a Java <code>float</code> value. The driver converts this to an SQL <code>FLOAT</code> value when it sends it to the database.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>parameterIndex</CODE> - the first parameter is 1, the second is 2, ...<DD><CODE>x</CODE> - the parameter value<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="setDouble(int, double)"><!-- --></A><H3>setDouble</H3><PRE>public void <B>setDouble</B>(int parameterIndex, double x) throws <A HREF="../../java/sql/SQLException.html">SQLException</A></PRE><DL><DD>Sets the designated parameter to a Java <code>double</code> value. The driver converts this to an SQL <code>DOUBLE</code> value when it sends it to the database.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>parameterIndex</CODE> - the first parameter is 1, the second is 2, ...<DD><CODE>x</CODE> - the parameter value<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="setBigDecimal(int, java.math.BigDecimal)"><!-- --></A><H3>setBigDecimal</H3><PRE>public void <B>setBigDecimal</B>(int parameterIndex, <A HREF="../../java/math/BigDecimal.html">BigDecimal</A> x) throws <A HREF="../../java/sql/SQLException.html">SQLException</A></PRE><DL><DD>Sets the designated parameter to a <code>java.math.BigDecimal</code> value. The driver converts this to an SQL <code>NUMERIC</code> value when it sends it to the database.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>parameterIndex</CODE> - the first parameter is 1, the second is 2, ...<DD><CODE>x</CODE> - the parameter value<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="setString(int, java.lang.String)"><!-- --></A><H3>setString</H3><PRE>public void <B>setString</B>(int parameterIndex, <A HREF="../../java/lang/String.html">String</A> x) throws <A HREF="../../java/sql/SQLException.html">SQLException</A></PRE><DL><DD>Sets the designated parameter to a Java <code>String</code> value. The driver converts this to an SQL <code>VARCHAR</code> or <code>LONGVARCHAR</code> value (depending on the argument's size relative to the driver's limits on <code>VARCHAR</code> values) when it sends it to the database.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>parameterIndex</CODE> - the first parameter is 1, the second is 2, ...<DD><CODE>x</CODE> - the parameter value<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="setBytes(int, byte[])"><!-- --></A><H3>setBytes</H3><PRE>public void <B>setBytes</B>(int parameterIndex, byte[] x) throws <A HREF="../../java/sql/SQLException.html">SQLException</A></PRE><DL><DD>Sets the designated parameter to a Java array of bytes. The driver converts this to an SQL <code>VARBINARY</code> or <code>LONGVARBINARY</code> (depending on the argument's size relative to the driver's limits on <code>VARBINARY</code> values) when it sends it to the database.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>parameterIndex</CODE> - the first parameter is 1, the second is 2, ...<DD><CODE>x</CODE> - the parameter value<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="setDate(int, java.sql.Date)"><!-- --></A><H3>setDate</H3><PRE>public void <B>setDate</B>(int parameterIndex, <A HREF="../../java/sql/Date.html">Date</A> x) throws <A HREF="../../java/sql/SQLException.html">SQLException</A></PRE><DL><DD>Sets the designated parameter to a <code<java.sql.Date</code> value. The driver converts this to an SQL <code>DATE</code> value when it sends it to the database.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>parameterIndex</CODE> - the first parameter is 1, the second is 2, ...<DD><CODE>x</CODE> - the parameter value<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="setTime(int, java.sql.Time)"><!-- --></A><H3>setTime</H3><PRE>public void <B>setTime</B>(int parameterIndex, <A HREF="../../java/sql/Time.html">Time</A> x) throws <A HREF="../../java/sql/SQLException.html">SQLException</A></PRE><DL><DD>Sets the designated parameter to a <code>java.sql.Time</code> value. The driver converts this to an SQL <code>TIME</code> value when it sends it to the database.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>parameterIndex</CODE> - the first parameter is 1, the second is 2, ...<DD><CODE>x</CODE> - the parameter value<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="setTimestamp(int, java.sql.Timestamp)"><!-- --></A><H3>setTimestamp</H3><PRE>public void <B>setTimestamp</B>(int parameterIndex, <A HREF="../../java/sql/Timestamp.html">Timestamp</A> x) throws <A HREF="../../java/sql/SQLException.html">SQLException</A></PRE><DL><DD>Sets the designated parameter to a <code>java.sql.Timestamp</code> value. The driver converts this to an SQL <code>TIMESTAMP</code> value when it sends it to the database.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>parameterIndex</CODE> - the first parameter is 1, the second is 2, ...<DD><CODE>x</CODE> - the parameter value<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="setAsciiStream(int, java.io.InputStream, int)"><!-- --></A><H3>setAsciiStream</H3><PRE>public void <B>setAsciiStream</B>(int parameterIndex, <A HREF="../../java/io/InputStream.html">InputStream</A> x, int length) throws <A HREF="../../java/sql/SQLException.html">SQLException</A></PRE><DL><DD>Sets the designated parameter to the given input stream, which will have the specified number of bytes.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -