Christina,
I had the same problem when I started using ESQL. What you're missing is that
you need a top-level element of your own as the first and only child of
<xsp:page>. So try moving your "users" element higher up the tree:
<xsp:page language="java"...>
<users>
<esql:connection>
...
<esql:results>
<esql:row-results>
....
</esql:row-results>
</esql:results>
</esql:connection>
</users>
</xsp:page>
Give that a try.
</Jeff>
"Christina"
<[EMAIL PROTECTED] To: <[EMAIL PROTECTED]>
il.com> cc:
Subject: [esql] Unhandled exception
type SQLException
06/27/2004 08:20
PM
Please respond to
users
Very simple query, but doesn't work. :(
My cocoon is 2.1.4 and my jdk is 1.4.2. I am using mysql. The same query
works fine with sql transformer.
<?xml version="1.0"?>
<xsp:page language="java" xmlns:xsp="http://apache.org/xsp" xmlns:esql="
http://apache.org/cocoon/SQL/v2">
<esql:connection>
<esql:pool>MYDB</esql:pool>
<esql:execute-query>
<esql:query>select uid from users</esql:query>
<esql:results>
<users>
<esql:row-results>
<user>
<login><esql:get-string column="uid"/></login>
</user>
</esql:row-results>
</users>
</esql:results>
<esql:no-results>
<p>Sorry, no results!</p>
</esql:no-results>
<esql:error-results>
There is error happened
</esql:error-results>
</esql:connection>
</xsp:page>
Error message:
Original Exception: org.apache.cocoon.components.language.LanguageException:
Error compiling mydb_xsp:
ERROR 1 (org\apache\cocoon\www\han\esql\mydb_xsp.java):
...
if (_esql_query != null) {
_esql_queries.push(_esql_query);
}
// start error (lines 306-306) "Unhandled exception type SQLException"
_esql_query = _esql_connection.createQuery(
// end error
String.valueOf(""),
String.valueOf(
""
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]