Skip to content

适用虚谷数据库版本

v12.9



适用虚谷数据库版本

v12.9


java.sql.PreparedStatement

📄字数 4.2K
👁️阅读量 加载中...

java.sql.PreparedStatement 已实现的接口

返回类型 方法描述
voidaddBatch()向这个 PreparedStatement对象的一批命令添加一组参数。
voidclearParameters()立即清除当前参数值。
booleanexecute()执行此 PreparedStatement对象中的SQL语句,这可能是任何类型的SQL语句。
default longexecuteLargeUpdate()执行在该SQL语句PreparedStatement对象,它必须是一个SQL数据操纵语言(DML)语句,如INSERT , UPDATE或DELETE ; 或不返回任何内容的SQL语句,例如DDL语句。
ResultSetexecuteQuery()执行此 PreparedStatement对象中的SQL查询,并返回查询 PreparedStatement的 ResultSet对象。
intexecuteUpdate()执行在该SQL语句PreparedStatement对象,它必须是一个SQL数据操纵语言(DML)语句,如INSERT , UPDATE或DELETE ; 或不返回任何内容的SQL语句,例如DDL语句。
ResultSetMetaDatagetMetaData()检索一个 ResultSetMetaData对象,其中包含有关执行此 PreparedStatement对象时将返回的 ResultSet对象的列的信息。
ParameterMetaDatagetParameterMetaData()检索此 PreparedStatement对象的参数的数量,类型和属性。
voidsetAsciiStream(int parameterIndex, InputStream x)将指定的参数设置为给定的输入流。
voidsetAsciiStream(int parameterIndex, InputStream x, int length)将指定的参数设置为给定的输入流,它将具有指定的字节数。
voidsetAsciiStream(int parameterIndex, InputStream x, long length)将指定的参数设置为给定的输入流,它将具有指定的字节数。
voidsetBigDecimal(int parameterIndex, BigDecimal x)将指定的参数设置为给定的 java.math.BigDecimal值。
voidsetBinaryStream(int parameterIndex, InputStream x)将指定的参数设置为给定的输入流。
voidsetBinaryStream(int parameterIndex, InputStream x, int length)将指定的参数设置为给定的输入流,它将具有指定的字节数。
voidsetBinaryStream(int parameterIndex, InputStream x, long length)将指定的参数设置为给定的输入流,它将具有指定的字节数。
voidsetBlob(int parameterIndex, Blob x)将指定的参数设置为给定的 java.sql.Blob对象。
voidsetBlob(int parameterIndex, InputStream inputStream)将指定的参数设置为 InputStream对象。
voidsetBlob(int parameterIndex, InputStream inputStream, long length)将指定的参数设置为 InputStream对象。
voidsetBoolean(int parameterIndex, boolean x)将指定的参数设置为给定的Java boolean值。
voidsetByte(int parameterIndex, byte x)将指定的参数设置为给定的Java byte值。
voidsetBytes(int parameterIndex, byte[] x)将指定的参数设置为给定的Java字节数组。
voidsetCharacterStream(int parameterIndex, Reader reader)将指定的参数设置为给定的 Reader对象。
voidsetCharacterStream(int parameterIndex, Reader reader, int length)将指定的参数设置为给定的 Reader对象,这是给定的长度的字符数。
voidsetCharacterStream(int parameterIndex, Reader reader, long length)将指定的参数设置为给定的 Reader对象,这是给定的长度的字符数。
voidsetClob(int parameterIndex, Clob x)将指定的参数设置为给定的 java.sql.Clob对象。
voidsetClob(int parameterIndex, Reader reader)将指定的参数设置为 Reader对象。
voidsetClob(int parameterIndex, Reader reader, long length)将指定的参数设置为 Reader对象。
voidsetDate(int parameterIndex, Date x)使用运行应用程序的虚拟机的默认时区将指定的 java.sql.Date设置为给定的 java.sql.Date值。
voidsetDate(int parameterIndex, Date x, Calendar cal)使用给定的 Calendar对象将指定的 Calendar设置为给定的 java.sql.Date值。
voidsetDouble(int parameterIndex, double x)将指定的参数设置为给定的Java double值。
voidsetFloat(int parameterIndex, float x)将指定的参数设置为给定的Java float值。
voidsetInt(int parameterIndex, int x)将指定的参数设置为给定的Java int值。
voidsetLong(int parameterIndex, long x)将指定的参数设置为给定的Java long值。
voidsetNCharacterStream(int parameterIndex, Reader value)将指定的参数设置为 Reader对象。
voidsetNCharacterStream(int parameterIndex, Reader value, long length)将指定的参数设置为 Reader对象。
voidsetNClob(int parameterIndex, NClob value)将指定的参数设置为 java.sql.NClob对象。
voidsetNClob(int parameterIndex, Reader reader)将指定的参数设置为 Reader对象。
voidsetNClob(int parameterIndex, Reader reader, long length)将指定的参数设置为 Reader对象。
voidsetNString(int parameterIndex, String value)将指定的参数设置为给定的 String对象。
voidsetNull(int parameterIndex, int sqlType)将指定的参数设置为SQL NULL 。
voidsetNull(int parameterIndex, int sqlType, String typeName)将指定的参数设置为SQL NULL 。
voidsetObject(int parameterIndex, Object x)使用给定对象设置指定参数的值。
voidsetObject(int parameterIndex, Object x, int targetSqlType)使用给定对象设置指定参数的值。
voidsetObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength)使用给定对象设置指定参数的值。
voidsetObject(int parameterIndex, Object x, SQLType targetSqlType)使用给定对象设置指定参数的值。
voidsetRowId(int parameterIndex, RowId x)将指定的参数设置为给定的 java.sql.RowId对象。
voidsetShort(int parameterIndex, short x)将指定的参数设置为给定的Java short值。
voidsetSQLXML(int parameterIndex, SQLXML xmlObject)将指定的参数设置为给定的 java.sql.SQLXML对象。
voidsetString(int parameterIndex, String x)将指定的参数设置为给定的Java String值。
voidsetTime(int parameterIndex, Time x)将指定的参数设置为给定的 java.sql.Time值。
voidsetTime(int parameterIndex, Time x, Calendar cal)使用给定的 Calendar对象将指定的 Calendar设置为给定的 java.sql.Time值。
voidsetTimestamp(int parameterIndex, Timestamp x)将指定的参数设置为给定的 java.sql.Timestamp值。
voidsetTimestamp(int parameterIndex, Timestamp x, Calendar cal)使用给定的 Calendar对象将指定的 Calendar设置为给定的 java.sql.Timestamp值。
voidsetURL(int parameterIndex, URL x)将指定的参数设置为给定的 java.net.URL值。

java.sql.PreparedStatement 未实现接口

返回类型方法描述
voidsetUnicodeStream(int parameterIndex, InputStream x, int length)已弃用 使用setCharacterStream
voidsetRef(int parameterIndex, Ref x)将指定的参数设置为给定的 REF(<structured-type>)值。
voidsetArray(int parameterIndex, Array x)将指定的参数设置为给定的 java.sql.Array对象。
voidsetObject(int parameterIndex, Object x, SQLType targetSqlType, int scaleOrLength)使用给定对象设置指定参数的值。