You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Sumit Ranjan <s_...@rti.daimlerchrysler.com> on 2001/08/27 08:57:01 UTC
database problem ...
in the sample database table "department_table" , whenever i add a new entry
the id generated is in the sequence 2,21,211,2111,21111 ...and so on....
is this a bug ? or am i doing anything wrong.
please suggest as i am new to cocoon.
i am using C2 on tomcat 3.2.2 and apache 1.3.11 on my NT 4.0 work statation.
Sumit Ranjan
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: database problem ...
Posted by Sumit Ranjan <s_...@rti.daimlerchrysler.com>.
hi java guru !
thanx for your reply.
but the problem is as it is.
i have checked the process-department.xsp file and there seems to be
nothing wrong.
here is my process-department.xsp file...
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page
language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:esql="http://apache.org/cocoon/SQL/v2"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
>
<xsp:logic>
String process = null;
String name = null;
int currId = -1;
</xsp:logic>
<page>
<xsp:logic>
process = <xsp-request:get-parameter name="process"/>;
name = <xsp-request:get-parameter name="name"/>;
</xsp:logic>
<title><xsp:expr>process</xsp:expr> Department Processed</title>
<content>
<esql:connection>
<esql:pool>personnel</esql:pool>
<esql:execute-query>
<esql:query>
select max(id) as maxid from department_table
</esql:query>
<esql:results>
<esql:row-results>
<xsp:logic>
currId = <esql:get-int column="maxid"/>;
</xsp:logic>
<esql:execute-query>
<esql:query>
insert into department_table (id, name) values (
(<esql:parameter><xsp:expr>currId</xsp:expr></esql:parameter> + 1),
<esql:parameter><xsp:expr>name</xsp:expr></esql:parameter>
)
</esql:query>
</esql:execute-query>
</esql:row-results>
</esql:results>
</esql:execute-query>
</esql:connection>
<para><xsp:expr>name</xsp:expr> added</para>
<a href="../welcome">Back to the welcome page</a>
</content>
</page>
</xsp:page>
moreover this behaviour is thrown only when i access these cocoon form from
my jetspeed portlet.
when i access the froms thro' cocoon itself , the forms work well.
please help.
TIA
sumit
----- Original Message -----
From: "java guru" <ja...@yahoo.co.in>
To: <co...@xml.apache.org>; "Sumit Ranjan"
<s_...@dbrci.blr.DaimlerBenz.COM>
Sent: Monday, August 27, 2001 5:13 PM
Subject: Re: database problem ...
> Please look at the process-department.xsp..
>
> You will understand...
>
> may be the <esql:parameter is considering string and
> so when u add 1 to string ... basically its taking
> result as string again.. so
>
> 2 + 1 = 21 (string expressions)
>
> 21 + 1 = 211 (String expressions)...
>
> :-)
>
> --- Sumit Ranjan <s_...@rti.daimlerchrysler.com>
> wrote: > in the sample database table
> "department_table" ,
> > whenever i add a new entry
> > the id generated is in the sequence
> > 2,21,211,2111,21111 ...and so on....
> >
> > is this a bug ? or am i doing anything wrong.
> >
> > please suggest as i am new to cocoon.
> >
> > i am using C2 on tomcat 3.2.2 and apache 1.3.11 on
> > my NT 4.0 work statation.
> >
> >
> > Sumit Ranjan
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > Please check that your question has not already been
> > answered in the
> > FAQ before posting.
> > <http://xml.apache.org/cocoon/faqs.html>
> >
> > To unsubscribe, e-mail:
> > <co...@xml.apache.org>
> > For additional commands, e-mail:
> > <co...@xml.apache.org>
> >
>
> =====
> Thanks and have great day
> srini
>
> ____________________________________________________________
> Do You Yahoo!?
> Send a newsletter, share photos & files, conduct polls, organize chat
events. Visit http://in/ groups.yahoo.com
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: database problem ...
Posted by java guru <ja...@yahoo.co.in>.
Please look at the process-department.xsp..
You will understand...
may be the <esql:parameter is considering string and
so when u add 1 to string ... basically its taking
result as string again.. so
2 + 1 = 21 (string expressions)
21 + 1 = 211 (String expressions)...
:-)
--- Sumit Ranjan <s_...@rti.daimlerchrysler.com>
wrote: > in the sample database table
"department_table" ,
> whenever i add a new entry
> the id generated is in the sequence
> 2,21,211,2111,21111 ...and so on....
>
> is this a bug ? or am i doing anything wrong.
>
> please suggest as i am new to cocoon.
>
> i am using C2 on tomcat 3.2.2 and apache 1.3.11 on
> my NT 4.0 work statation.
>
>
> Sumit Ranjan
>
>
>
>
---------------------------------------------------------------------
> Please check that your question has not already been
> answered in the
> FAQ before posting.
> <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail:
> <co...@xml.apache.org>
> For additional commands, e-mail:
> <co...@xml.apache.org>
>
=====
Thanks and have great day
srini
____________________________________________________________
Do You Yahoo!?
Send a newsletter, share photos & files, conduct polls, organize chat events. Visit http://in/ groups.yahoo.com
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>