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

initialization of variables type int as null

 
Yanine Arellano
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi everyone, i have a store procedure in which one of the IN variables is an int and i have to send it as null, although whether i try this:
int count= null;
or
int count;
gives me error
How should i do it?

int count; --- this is where I initialize the variable and needs to be set as null.

CallableStatement ct = conn.prepareCall("{call fon.pck_mt3.db_mt3_deptran(?,?,?,?,?,?,?,?,?,?,?)}");

ct.setInt(1,count); // 1 count IN NUMBER, -- (15)

Thanks a lot, bye bye.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try setNull().
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic