wood burning stoves 2.0*
The moose likes JDBC 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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: passing null from Jdbc to Oracle(URGENT)
 
Similar Threads
Stored procedres
Kind Advice
Connect oracle databse from Websphere 6.1 with OS Authentication
JDBC using Oracle with Servlets
jdbc connection error!!!!