This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes setInt Null Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "setInt Null" Watch "setInt Null" New topic

setInt Null

anvi kon
Ranch Hand

Joined: Jan 08, 2010
Posts: 133

Can anyone help me?

How to set Null in the preparedstatement.setInt(NULL) in jdbc?


Syed Ullah

Joined: Mar 10, 2010
Posts: 9
stmt.setNull(2, java.sql.Types.INTEGER);

Here 2 is the column index. Replace it with your index variable/value.
I agree. Here's the link:
subject: setInt Null
Similar Threads
object reference variables as literals?
What value does readLine() return when it has reached the end of a file
WA #1.....word association
Values of Hash Map to be 2-dimensional array
SCJP Brainteaser (1)