cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ypomonh <ypom...@freemail.gr>
Subject (newbie) Query a given datasource from a javascript flow?
Date Fri, 11 May 2007 13:15:05 GMT
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


Mime
View raw message