This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to set a null and how to retrieve it

 
ramchander yshetti
Ranch Hand
Posts: 97
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai,
how to set a null values into a table and
how to retrieve the null values from the table

i used the methods
setNull() and getNull() i am not getting
please solve my query with example..

thank Q

bye.
 
Jan Cumps
Bartender
Posts: 2577
11
C++ Linux Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To set null values:
PreparedStatement.setNull().

To check null values: ResultSet.wasNull().

Regards, Jan
[ April 24, 2007: Message edited by: Jan Cumps ]
 
Gaurav Chikara
Ranch Hand
Posts: 412
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


To check null values: ResultSet.wasNull().


ResultSet's wasNull only checks if last column read was Null
Better and scalable approach is always to write a utility class for checking null value and check the value returned against it
e.g. You wrote Util.java and one of the methods is
boolean isNull(Object obj)

then simply use it and you will know if the value returned is Null or not
[ April 24, 2007: Message edited by: Gaurav Chikara ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic