cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Noels <>
Subject Database.js
Date Wed, 20 Aug 2003 07:05:00 GMT
Hi peeps,

I'm messing around with the GetTogether registration page, which gives 
me a chance to test all this new wonderful Woody & flow stuff, but I'm 
stuck on the usage of Database.js. I'm not planning to use any O/R 
mapping, since I'll have two tables at most.

In PetStoreImpl.js, there's a code fragment that reads:

PetStore.prototype.getConnection = function(id) {
     if (true) {
         // temporary hack to avoid requiring datasource config in 
         var jdbc = 
java.sql.DriverManager.getConnection("jdbc:hsqldb:.", "sa", "")
         var conn = new Database(jdbc);
         if (this.hsql == null) {
             // keep hsql in-memory database alive
             this.hsql = 
java.sql.DriverManager.getConnection("jdbc:hsqldb:.", "sa", "");
         return conn;
     } else {
         // lookup datasource in cocoon.xconf
         return Database.getConnection(id);

but since I want to use my cocoon.xconf datasources config, I'm trying 
to set up a connection using:


Registration.prototype.getConnection = function(id) {
	return Database.getConnection(id);


var conn = this.getConnection(id);


I'm greeted however with the interesting message: The undefined value 
has no properties. Has anyone already played with this? I'm looking for 
a snippet of sample code, without the weight that Petstore carries, to 
open a connection to a cocoon.xconf-defined pool.


Steven Noels                  
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog at  
stevenn at                stevenn at

View raw message