File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I need to insert null in NUMBER field which is nullable

 
lalitha prasad
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I need to do the following.

pst.setInt(1,null);

Is it possible?.

If anyone knows please help me.

thanks in advance,
LALITH
 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess the following might work.

PreapredStatement.setNull()

public void setNull(int parameterIndex, int sqlType) throws SQLException
Sets the designated parameter to SQL NULL.
 
Ed Wallen
Ranch Hand
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Call the setNull method on your prepared statement object (in your case, "pst") and pass it the appropriate type (in your case Types.INTEGER).


pst.setNull(index, Types.INTEGER);

-Ed
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic