Sets the designated parameter to SQL NULL
.
This version of the method setNull
should
be used for user-defined types and REF type parameters. Examples
of user-defined types include: STRUCT, DISTINCT, JAVA_OBJECT, and
named array types.
Note: To be portable, applications must give the SQL type code and the fully-qualified SQL type name when specifying a NULL user-defined or REF parameter. In the case of a user-defined type the name is the type name of the parameter itself. For a REF parameter, the name is the type name of the referenced type. If a JDBC driver does not need the type code or type name information, it may ignore it. Although it is intended for user-defined and Ref parameters, this method may be used to set a null parameter of any JDBC type. If the parameter does not have a user-defined or REF type, the given typeName is ignored.
parameterIndex | the first parameter is 1, the second is 2, ... | |
sqlType | a value from java.sql.Types | |
typeName | the fully-qualified name of an SQL user-defined type; ignored if the parameter is not a user-defined type or REF |
SQLException | if parameterIndex does not correspond to a parameter
marker in the SQL statement; if a database access error occurs or
this method is called on a closed PreparedStatement | |
SQLFeatureNotSupportedException | if sqlType is
a ARRAY , BLOB , CLOB ,
DATALINK , JAVA_OBJECT , NCHAR ,
NCLOB , NVARCHAR , LONGNVARCHAR ,
REF , ROWID , SQLXML
or STRUCT data type and the JDBC driver does not support
this data type or if the JDBC driver does not support this method |
Diagram: Statement