ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <rambabu.pir...@wipro.com>
Subject Error while inserting Null value into MsSQL db
Date Wed, 26 Jul 2006 14:16:36 GMT


Hi,

   I am using Ibatis as the data mapper between my java classes and
MsSql database. When I am trying to insert null value using java object
  i am getting the null pointer exception.

   but if i directly insert null it works fine.

  For example:


<insert id="insertStaticProperties" parameterClass="user">

insert into USR_BASIC_INFO values (#userid#, #password#, #username#,
#role#, #code#, #email#, #phonenumber#, #description#)

</insert>

The above query throws NULL pointer exception when any of the field
value is null. say #password is NULL.



<insert id="insertStaticProperties" parameterClass="user">

insert into USR_BASIC_INFO values (#userid#, null, #username#, #role#,
#code#, #email#, #phonenumber#, #description#)

</insert>

this works fine. can you please throw some light on this.

Thanks n Regards,
==============

Rambabu



The information contained in this electronic message and any attachments to this message are
intended for the exclusive use of the addressee(s) and may contain proprietary, confidential
or privileged information. If you are not the intended recipient, you should not disseminate,
distribute or copy this e-mail. Please notify the sender immediately and destroy all copies
of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email
and any attachments for the presence of viruses. The company accepts no liability for any
damage caused by any virus transmitted by this email.

www.wipro.com
Mime
View raw message