cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Haul <h...@dvs1.informatik.tu-darmstadt.de>
Subject Re: Cocoon generated Java throwing SQLException
Date Thu, 02 May 2002 07:26:33 GMT
On 01.May.2002 -- 09:54 PM, Zack Angelo wrote:
> Hey,
> 
> I'm having some really peculiar behavior with the ESQL logicsheet. I
> have the following XSP (in my own logicsheet):
> 
> <esql:query> select ID,count(ID) as count from Users where
> LoginUser='zack' and Password='password' group by ID</esql:query>
> 
> The corresponding Java seems to be generating just fine: 
> 
> _esql_query = new EsqlQuery( _esql_connection, String.valueOf("select
> ID,count(ID) as count from Users where LoginUser='zack' and
> Password='password' group by ID") );
> 
> But, upon execution, I get this exception:
> 
> org.apache.cocoon.ProcessingException: Exception in
> ServerPagesGenerator.generate(): java.lang.RuntimeException: Error
> executing statement: select ID,count(ID) as count from Users where
> LoginUser='zack' and Password='password' group by ID:
> java.sql.SQLException: Column not found: Unknown column 'LoginUser' in
> 'where clause'
> 
> For some reason it's saying that one of the columns doesn't exist...I
> have no idea why. I've also copied and pasted the SQL query from the
> Java into the mysql client, and it works fine. Any ideas? This just
> seems really strange to me. Thanks in advance.

It seems to be a problem with the mySQL jdbc driver. I believe we had
another user reporting similar problems with mySQL. I *think* a solution
was using only lower case coulmn names. According to the SQL standard,
case does not matter because everything is converted to uppercase internally,
except for strings within quotes.

If the table belongs to another user / schema, you might need to qualify it
with the user name.

Please check with a small java program that the driver is OK.

HTH.

	Chris.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

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