cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@ellisdunes.org
Subject RE: (newbie) Query a given datasource from a javascript flow?
Date Fri, 11 May 2007 14:42:11 GMT



Look in the samples that ship with Cocoon. There's a sample in the forms
block titled 'Easy SQL database access'. 

                                                                  J.
Toman


----------------------------

http://lillibilli.com
Web Hosting, Domain Names, & more!



> -------- Original Message --------
> Subject: (newbie) Query a given datasource from a javascript flow?
> From: ypomonh <ypomonh@freemail.gr>
> Date: Fri, May 11, 2007 6:15 am
> To: users@cocoon.apache.org
> 
> I'm searching an easy way to query a given datasource (defined in) from 
> within a flow (javascript). Not using an ORM framework but even plain
> JDBC.
> 
> Have tried to use 
> org.apache.cocoon.components.flow.javascript.ScriptableConnection:
> 
>     
> importPackage(Packages.org.apache.cocoon.components.flow.javascript.ScriptableConnection);
>    
>     var db = Database.getConnection("mydatasource");
>     var queryVal = cocoon.parameters["rid"];
>     var startRow = 0;
>     var maxRows = 100;
> 
>      row = db.query("select * from report_parameter_map where report_id 
> = ?", queryVal, startRow, maxRows);
>      print (row.rowCount);
> 
> but get : "'Database' is not defined" ?
> 
> Is there a simpler way to query a given datasource from within a flow 
> (javascript)?
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message