From: JD Daniels > ok, I am confused on what is happening to the Datbase.js > file. but instead of a request for the long explanation, I > will settle for a quick yes or no. > > I am a java newbie... so bear with me... > > From the petstore: > > // temporary hack to avoid requiring datasource > config in cocoon.xconf > java.lang.Class.forName("org.hsqldb.jdbcDriver"); > 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); > } > > Is what has been talked about here on the list mean the "Best > Practice" way to get a database connection in flow is the way > that is commented here as a "temporary hack" ie. use > java.lang.whatever and code as if we were writing the app in > pure java?
IMO no. I would use Object/Relational mapping tools like OJB http://db.apache.org/ojb/ or Hibernate (http://hibernate.bluemars.net). > Is there a wiki somewhere on this type of thing? http://wiki.cocoondev.org/Wiki.jsp?page=XMLFormJXFormHibernateAndFlowscr ipt and here you find a component providing a Hibernate session: http://cvs.werken.com/viewcvs.cgi/plexus-components/hibernate /src/java/org/apache/plexus/hibernate/DefaultHibernateService.java?cvsro ot=plexus > (I have been > building apps in PHP and PERL for a few years, and its gets > frustrating KNOWING way better tools are RIGHT HERE in front of me :) Currently we are finishing the flow itself and try to find a way how to continue with XMLForms/JXForms in the future. After this we will have to write *a lot of* documentation. I know, this doesn't help you right now but of course we can help you here on the cocoon mailing lists. ;-) hint: We would be very pleased if you could help us writing some of the docs that guide other users into the right direction if they have similar problems (espacially as you have a lot of knowledge in other languages/framworks and this is of course one of our most important target groups) > Sorry if this is a pain in the *** question, bu tthe idea of > flow has me giddy. But I am stuck on the "cannot convert null > to an object issue" Where do you get this error? Usually this happens if you change your scripts and the context is reset and all variables are reset. Cheers, Reinhard