I'm trying to see how ScriptableConnection works so I have a basic flow:

importPackage(Packages.org.apache.cocoon.components.flow.javascript.ScriptableConnection);

   var db = Database.getConnection("myConnection");
   var queryVal = cocoon.parameters["rid"];
   var startRow = 0;
   var maxRows = 100;

row = db.query("select * from my_table where rid = ?", queryVal, startRow, maxRows);
    print (row.rowCount);

but I get the error:

   org.mozilla.javascript.EcmaError: "Database" is not defined

Am I missing something..? How should I define "Database"..?



(http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/components/flow/javascript/ScriptableConnection.html)




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to