aspose file tools*
The moose likes JDBC and the fly likes initialization of variables type int as null Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "initialization of variables type int as null" Watch "initialization of variables type int as null" New topic
Author

initialization of variables type int as null

Yanine Arellano
Greenhorn

Joined: Mar 14, 2007
Posts: 3
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

Joined: Apr 14, 2004
Posts: 10336

Try setNull().


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: initialization of variables type int as null
 
Similar Threads
Would like help about this excercise in HFJ
Java Recursion and binary tree searching questions
SELECT COUNT
Database Metadata
How to make combination function generic