aspose file tools
The moose likes JDBC and Relational Databases and the fly likes passing null from Jdbc to Oracle(URGENT) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "passing null from Jdbc to Oracle(URGENT)" Watch "passing null from Jdbc to Oracle(URGENT)" New topic
Author

passing null from Jdbc to Oracle(URGENT)

nandkishor rao
Ranch Hand

Joined: May 24, 2006
Posts: 53
I want to pass null to Oracle database from Jdbc
so my question is can I pass a "null" as a String?(Like pstmt.setString(3, "null");
Will it make any difference? Let me know am i right or not
and some other ways by which we can pass null value.
Thanks
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

when you write your code like this


so "null" is a value like anything you write inside double qoutes.

your null assinging code would be like this.. but make sure you have already allowed null in your database column.


Saifuddin..
[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1081

I would recommend that you do like this



Shailesh


Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
nandkishor rao
Ranch Hand

Joined: May 24, 2006
Posts: 53
Thanks.
 
jQuery in Action, 2nd edition
 
subject: passing null from Jdbc to Oracle(URGENT)