cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Viktors Rotanovs <vikt...@riga.nu>
Subject Re: cannot get ESQL to work... urgent
Date Wed, 13 Sep 2000 02:37:31 GMT
Hi,

there is esql sample at samples/sql, basically it's
something like this:
<esql:execute-query>
	<esql:use-connection>ConnectionName</esql:use-connection>
	<esql:query>
		SELECT
			Some_Column
		FROM
			Table_Name
	</esql:query>
	<esql:results>
		Some_Column is: <esql:get-string column="Some_Column"/>
	</esql:results>
	<esql:no-results>
		No rows found
	</esql:no-results>
</esql:execute-query>

Don't forget to define connection in cocoon.properties like this:
processor.xsp.pool.database.ConnectionName.driver=org.postgresql.Driver
processor.xsp.pool.database.ConnectionName.url=jdbc:postgresql:DatabaseName
processor.xsp.pool.database.ConnectionName.username=Username
processor.xsp.pool.database.ConnectionName.password=Password
processor.xsp.pool.database.ConnectionName.maxConnections=5
processor.xsp.pool.database.ConnectionName.expiryTime=3600000                 
            
Of course you should replace ConnectionName, DatabaseName, Username
and Password with your values, and possibly adjust other parameters (like
database driver and url).

Also check if you referred to the logicsheet like this:
<?xml-logicsheet 
href="resource://org/apache/cocoon/processor/xsp/library/sql/esql.xsl"?>

And, remember, if you will pass variables from requests directly
to sql queries, escape them first, otherwise site will be vulnerable to
all sorts of attacks.

On Wed, 13 Sep 2000, you wrote:
> >From: "Nicola Ken Barozzi" <nicolaken@supereva.it>
> >Reply-To: "Nicola Ken Barozzi" <nicolaken@supereva.it>
> >To: <cocoon-users@xml.apache.org>
> >Subject: Re: cannot get ESQL to work... urgent
> >Date: Tue, 12 Sep 2000 22:13:40 +0200
> >
> >----- Original Message -----
> >From: "Saif Khaja" <ksaif25@hotmail.com>
> >To: <cocoon-users@xml.apache.org>
> >Sent: Tuesday, September 12, 2000 9:53 PM
> >Subject: cannot get ESQL to work... urgent
> >
> >everything is urgent ;-)
> >
> >
> >
> >The right declaration is:
> >
> ><xsp:page
> >   language="java"
> >   xmlns:esql="http://apache.org/cocoon/SQL/v2"
> >   xmlns:xsp="http://www.apache.org/1999/XSP/Core"
>
> With this it does finds the "esql" tag but it gives a
> "NullPointerException". I have no idea what other PIs are needed to be
> included. Are there any examples out there which can give us an idea how to
> use it.
>
> Thanx,
> saif.
>
> >nicola_ken
> >
> >Nicola Ken Barozzi - AISA Industries S.p.A
> >http://www.aisaindustries.it/
> >Via Leonardo da Vinci,2 Ticengo (CR) Italy
> >Research Activity:
> >Politecnico di Milano - Dipartimento di Meccanica
> >Piazza Leonardo da Vinci, n.32 - 20133 Milano (Italy)
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> >For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
> Share information about yourself, create your own public profile at
> http://profiles.msn.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org

-- 
Best Wishes,
Viktors Rotanovs
I create websites that attract more clients. http://riga.nu/
Riga Latvia +371, Phone 7377-142, GSM 9173-000, FAX 7377-472

Mime
View raw message