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: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to