cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Yates <ceya...@pacbell.net>
Subject Re: built sql query
Date Mon, 10 Jul 2000 16:05:45 GMT
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
This works for me using url:
<br><A HREF="http://blah/db.xml?columns=*&table=sometable&amp;amp;column=id&amp;amp;parameter=50">http://blah/db.xml?columns=*&amp;table=sometable&amp;amp;column=id&amp;amp;parameter=50</A>
<p>&lt;?xml version="1.0"?>
<br>&lt;?cocoon-process type="xsp"?>
<br>&lt;?cocoon-process type="sql"?>
<br>&lt;?cocoon-process type="xslt"?>
<br>&lt;?xml-stylesheet type="text/xsl" href="db.xsl"?>
<p>&lt;xsp:page
<br>&nbsp; language="java"
<br>&nbsp; xmlns:xsp="<A HREF="http://www.apache.org/1999/XSP/Core">http://www.apache.org/1999/XSP/Core</A>">
<br>&lt;page>
<br>&nbsp;
<br>&nbsp;&lt;connectiondefs>
<br>&nbsp; &lt;connection name="connection">
<br>&nbsp;&nbsp; &lt;driver>{driver}&lt;/driver>
<br>&nbsp;&nbsp; &lt;dburl>{dburl}&lt;/dburl>
<br>&nbsp;&nbsp; &lt;username>{username}&lt;/username>
<br>&nbsp;&nbsp; &lt;password>{password}&lt;/password>
<br>&nbsp; &lt;/connection>
<br>&nbsp;&lt;/connectiondefs>
<br>&nbsp;
<br>&nbsp;&lt;query connection="connection">
<br>&nbsp; select &lt;xsp:expr>request.getParameter("columns")&lt;/xsp:expr>
<br>&nbsp; from &lt;xsp:expr>request.getParameter("table")&lt;/xsp:expr>
<br>&nbsp; where &lt;xsp:expr>request.getParameter("column")&lt;/xsp:expr>
<br>&nbsp; = '&lt;xsp:expr>request.getParameter("parameter")&lt;/xsp:expr>'
<br>&nbsp;&lt;/query>
<br>&nbsp;
<br>&lt;/page>
<br>&lt;/xsp:page>
<p>Torsten Curdt wrote:
<blockquote TYPE=CITE>I know now how to do and display a sql query with
cocoon.
<br>But can anyone show me a good way to do a built query?
<p>I mean a query that is modified by the parameters passed
<br>to the page (a very common task)
<p>something like:
<p>show.xml?id=50 -> select * from sometable where tableid=50
<p>actually the question is: how can I pass my java built
<br>sql string to the sql processor?
<br>--
<br>Torsten
<p>---------------------------------------------------------------------
<br>To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
<br>For additional commands, e-mail: cocoon-users-help@xml.apache.org</blockquote>

<pre>--&nbsp;
<A HREF="http://home.pacbell.net/ceyates">http://home.pacbell.net/ceyates</A></pre>
&nbsp;</html>


Mime
View raw message