cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Newland" <chris.newl...@emorphia.com>
Subject Possible to assign SQL query result to XSP variable?
Date Mon, 20 Aug 2001 11:21:15 GMT
Hi All,

I'm trying to test for the presence of a key in an SQL table by performing
an SQL query and having the result (or null) set in an XSP variable:

<para>checking for username = <xsp:expr>username</xsp:expr></para>

String got_uname = "dummy";

  <esql:connection>
        <esql:pool>my_jdbc</esql:pool>
        <esql:execute-query>
                <esql:query>
                  select id from enduser where enduser.id =
<esql:parameter><xsp:expr>username</xsp:expr></esql:parameter>
                </esql:query>
		<esql:row-results>
                	got_uname = <esql:get-string column="id"/>;
            </esql:row-results>
        </esql:execute-query>
  </esql:connection>

<para>got value from db uname = <xsp:expr>got_uname</xsp:expr></para>

where 'id' is the primary key column in the enduser table.

Is this even a rational thing to try and do?

When the page executes, the value for got_uname is "dummy" and the Java code
created from the page does not attempt to assign the got_uname variable to
the SQL result.

Can somebody let me know if it is actually possible/reasonable to try and
assign XSP variables from SQL queries?

Thanks for your help,

Chris



---------------------------------------------------------------------
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