cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jon Brisbin" <bris...@ipa.net>
Subject RE: Probs with INSERT and esql
Date Sat, 24 Feb 2001 17:50:04 GMT
i tried that several different times and ways and absolutely nothing
worked...i'm just using c1.8.2/mysql 3.22.32/mm.mysql2 and the insert would
never execute...i would get NullPointerException's doing it the below way if
there was nothing in the form field (i assume that's what caused it, not
sure though)...the plain java code is directly from a jsp page i had been
using previously...

the solution i came up with is terrible!  i'm using the old jsp page (which
just inserts and does a redirect) to insert the data into the database...i
don't like this and would prefer to have it all xml...

jb

-----Original Message-----
From: Matthew Cordes [mailto:mcorde61@maine.edu]
Sent: Saturday, February 24, 2001 11:42 AM
To: cocoon-users@xml.apache.org
Subject: Re: Probs with INSERT and esql


Hi,
I'm a little confused by your method, instead of:

> <esql:execute-query>
>     <esql:query>
>         <xsp:logic>
>             StringBuffer sql = new StringBuffer("insert into new_address
> values(");
>             sql.append(" '").append(request.getParameter("member_id"));
> ...
>             System.err.println(sql.toString());
>             <xsp:expr>sql.toString()</xsp:expr>
>         </xsp:logic>
>     </esql:query>

why not do:

<esql:query>
    insert into new_address values (
        <esql:parameter><request:get-parameter
name="member_id"/></esql:parameter> )
</esql:query>

Hope this helps.

-matt
----- Original Message -----
From: "Jon Brisbin" <brisbin@ipa.net>
To: <cocoon-users@xml.apache.org>; "Paul Russell" <prussell@apache.org>
Sent: Saturday, February 24, 2001 9:33 AM
Subject: RE: Probs with INSERT and esql


>
>
> >* Jon Brisbin (brisbin@ipa.net) wrote :
> >> java.lang.Exception: XSP Java Compiler: Compilation failed for
> >> _member_profile_insert.java
> >> 176: ')' expected.
> >>                     StringBuffer sql = new StringBuffer("insert into
> >> new_address values(");
> >>                                 ^
> >> 1 error
>
> >Looks like it could be a bug. Can you provide us with the fragment of
> >XML that caused it?
>
> <esql:execute-query>
>     <esql:query>
>         <xsp:logic>
>             StringBuffer sql = new StringBuffer("insert into new_address
> values(");
>             sql.append(" '").append(request.getParameter("member_id"));
> ...
>             System.err.println(sql.toString());
>             <xsp:expr>sql.toString()</xsp:expr>
>         </xsp:logic>
>     </esql:query>
>     ...
>
> Thanks!
>
> Jon Brisbin
> www.jbrisbin.net
>
>
> ---------------------------------------------------------------------
> 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: <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail: <cocoon-users-help@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: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message