struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "sudheshna aaa" <>
Subject RE: how to insert null using sql query in java code
Date Tue, 27 Apr 2004 17:18:46 GMT
Try checking the variables for null and if null put emtpy string

Something like this:
(webpurchased == null)?"":webpurchased

>From: Jignesh Patel <>
>Reply-To: "Struts Users Mailing List" <>
>To: "Struts Users Mailing List" <>
>Subject: how to insert null using sql query in java code
>Date: Sun, 25 Apr 2004 14:33:05 +0530
>Hi All,
>I am following query to insert value in databse now suppose value of
>"webpurchased","targetadvt" and 'trial" is null then how can I can insert
>same null value in database.
>Because my parameter is like String webpurchased=null --In this case value 
>webpurchase will be replaced by string 'null' while insering, which is
>meaning less. I want to insert real null.
>MY query:
>    		stmt.executeQuery("INSERT INTO advt_spns_soln VALUES "+
>		 "(advt_spns_soln_id.nextval,'"+firstName+"','"+lastName+"','"+title+ 
>To unsubscribe, e-mail:
>For additional commands, e-mail:

>From must-see cities to the best beaches, plan a getaway with the Spring 
Travel Guide!

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message