cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicki Møller <nicki_mol...@yahoo.dk>
Subject Re: AW: Wildcard in a SQL-query??
Date Mon, 24 Jul 2000 09:52:31 GMT
Hi Ulrich,

Thanxs but when I try you suggestion I get this
error-msg. 

Error found handling the request.
java.lang.Exception: XSP Java Compiler: Compilation
failed for _dayEvents.java
 String not terminated at end of line.
 "Error during query: Unexpected Exception:
java.sql.SQLException message given: Syntax error or
access violation: You have an error in your SQL syntax
near 'ORDER BY Starttime Desc
         ^
   88: ')' expected.
    ' at line 3"
   ^
   88: Invalid character constant.
    ' at line 3"
    ^
   3 errors
   	at
org.apache.cocoon.processor.xsp.language.java.XSPJavaProcessor.compile(XSPJavaProcessor.java:142)
   	at
org.apache.cocoon.processor.xsp.XSPProcessor.process(XSPProcessor.java:445)
   	at
org.apache.cocoon.Engine.handle(Engine.java:283)
   	at
org.apache.cocoon.Cocoon.service(Cocoon.java:145)
   	at
javax.servlet.http.HttpServlet.service(HttpServlet.java:309)
   	at
org.apache.jserv.JServConnection.processRequest(JServConnection.java:314)
   	at
org.apache.jserv.JServConnection.run(JServConnection.java:188)
   	at java.lang.Thread.run(Thread.java:475)

Does this make any sense to you??

-Nicki


--- Ulrich Mayring <ulim@denic.de> skrev: > Nicki
Møller wrote:
> > 
> > Hi Henning,
> > 
> > True sorry but the examples was only to give an
> Idea
> > of what I was searching for. I guess I didn't do
> that
> > very well. So here I go again
> > 
> > I'm looking for a way to refere to the variable
> that I
> > create exactly like this
> > 
> > <xsp:logic>
> >  String day = request.getParameter ("day");
> >  day.trim();
> >  day = "'" + day + "%'";
> > </xsp:logic>
> > 
> > In my query I'd like to use the day-var like this.
> > 
> > SELECT Event_Id, Body, Starttime, Endtime FROM
> Events
> > WHERE Starttime LIKE day ORDER BY Starttime Desc
> 
> put this before your root tag:
> 
> <xsp:logic>
> private String getDay() {
> 	String day = request.getParameter ("day");
> 	day.trim();
> 	day = "'" + day + "%'";
> 	}
> </xsp:logic>
> 
> and, instead of day, you write in your query
> <xsp:expr>getDay()</xsp:expr>
> 
> Ulrich
> 
> -- 
> Ulrich Mayring
> DENIC eG, Systementwicklung
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail:
> cocoon-users-help@xml.apache.org
> 


______________________________________________________
Do You Yahoo!?
Få en gratis @yahoo.dk-adresse på http://mail.yahoo.dk

Mime
View raw message