Return-Path: Mailing-List: contact cocoon-users-help@xml.apache.org; run by ezmlm Delivered-To: mailing list cocoon-users@xml.apache.org Received: (qmail 81618 invoked from network); 4 Nov 2000 20:28:16 -0000 Received: from f206.law4.hotmail.com (HELO hotmail.com) (216.33.149.206) by locus.apache.org with SMTP; 4 Nov 2000 20:28:16 -0000 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Sat, 4 Nov 2000 12:27:50 -0800 Received: from 148.88.0.11 by lw4fd.law4.hotmail.msn.com with HTTP; Sat, 04 Nov 2000 20:27:50 GMT X-Originating-IP: [148.88.0.11] From: "Robin Green" To: cocoon-users@xml.apache.org Subject: Re: Help! connecting to a database Date: Sat, 04 Nov 2000 20:27:50 GMT Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 04 Nov 2000 20:27:50.0475 (UTC) FILETIME=[B3AEA1B0:01C0469D] X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Sorry if this reply is a bit redundant but there were some things which I don't think have been mentioned. "Sergei O . Naumov" wrote: >Hi! >I am starting to develop a large Cocoon based project that needs to query a >database >(it will probably be Oracle). The question I have is on the good way to >connect >to >a database from XSP. In a servlet world, one connects to a database on the >startup >and uses this db handle to eliminate db connection overhead. Actually no, it's not that simple, because connections may time out and should not be used by multiple threads simultaneously. So instead you would use a connection pool. Cocoon has just such a connection pool, which can be used either in your own code or by the sql or esql taglibs: http://xml.apache.org/cocoon/connection-pool.html >I was thinking on having a taglib that would implement all the Java methods >that >work with a database, and just use those in my XSP pages. No need to reinvent the wheel. The esql taglib performs the hard work, and lets you insert arbitrary preprocessing logic by using esql:get-string etc. - totally flexible. >Can anyone give some sort of suggestion on how to go around this? It would >be >just >wonderful if there are some code examples on that. samples/sql/esql.xsl You'll need at least Cocoon 1.8 of course. _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. Share information about yourself, create your own public profile at http://profiles.msn.com.