| 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
|
 |
 |
|
|
subject: initialization of variables type int as null
|
|
|