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 <[EMAIL PROTECTED]>
> Date: Fri, May 11, 2007 6:15 am
> To: [email protected]
>
> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]