tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "PAZDZIOREK,LUKASZ (HP-Poland,ex1)" <lukasz.pazdzio...@hp.com>
Subject DBTags Taglib
Date Wed, 06 Aug 2003 10:14:03 GMT
Hi Everybody,

I am trying to process web form and insert its values to the database using
DBTags.
This is what I am doing:

<%-- insert a row into the database --%>
<sql:preparedStatement id="stmt1" conn="conn">
  <sql:query>
   INSERT INTO CUSTOMER (CUST_PHONENO, CUST_NAME, CUST_SURNAME, CUST_TOWN,
CUST_EMAIL, CUST_USERNAME, CUST_PASSWORD, CUST_WWW_REGISTERED_DATE,
CUST_FK_CT_ID, CUST_FK_CS_ID) values (?,?,?,?,?,?,?,?,?,?)
  </sql:query>
    <sql:setColumn position="1">48<%=
CustomerBean.getPhone_no()%></sql:setColumn>
    <sql:setColumn position="2"><%= CustomerBean.getName()%></sql:setColumn>
    <sql:setColumn position="3"><%=
CustomerBean.getSurname()%></sql:setColumn>
    <sql:setColumn position="4"><%= CustomerBean.getTown()%></sql:setColumn>
    <sql:setColumn position="5"><%=
CustomerBean.getEmail()%></sql:setColumn>
    <sql:setColumn position="6"><%=
CustomerBean.getLogin()%></sql:setColumn>
    <sql:setColumn position="7"><%=
CustomerBean.getPasswd()%></sql:setColumn>
    <sql:setColumn position="8"><%=
sqlDateTimeFormat_.format(Callendar_.getTime()) %> </sql:setColumn>
    <sql:setColumn position="9">WWW</sql:setColumn>
    <sql:setColumn position="10">ACTIVE</sql:setColumn>
  <sql:execute/>
</sql:preparedStatement>

I have one problem: 3 fileds in the formcould be emtand I would like to live
these database fields set as NULL,
How can I do it? Is it possible to insert NULL value using
"preparedStatement" tag ?

thank you for your help.

regards,
lukas

Mime
View raw message