PreparedStatement setNull(..)

后端 未结 5 1353
走了就别回头了
走了就别回头了 2020-11-28 06:32

Java PreparedStatement provides a possibility to explicitely set a Null value. This possibility is:

prepStmt.setNull(parameterIndex, Types.VARCHAR);
<         


        
5条回答
  •  渐次进展
    2020-11-28 07:19

    Finally I did a small test and while I was programming it it came to my mind, that without the setNull(..) method there would be no way to set null values for the Java primitives. For Objects both ways

    setNull(..)
    

    and

    set(.., null)) 
    

    behave the same way.

提交回复
热议问题