Here's some sample code of what I mean - with this code, you can pass in the dburl, username, and password from a form:

<xsp:page
        xmlns:xsp="http://apache.org/xsp"
        xmlns:esql="http://apache.org/cocoon/SQL/v2"
>

        <html>
                <body>
                        <esql:connection>
                                <esql:dburl><xsp:expr>request.getParameter("dburl")</xsp:expr></esql:dburl>
                                <esql:username><xsp:expr>request.getParameter("username")</xsp:expr></esql:username>
                                <esql:password><xsp:expr>request.getParameter("password")</xsp:expr></esql:password>
                                <esql:execute-query>
                                        <esql:query>
                                                select count(*) from person
                                        </esql:query>
                                        <esql:results>
                                                <esql:row-results>
                                                        <b>Count: <esql:get-int column="1"/></b>
                                                </esql:row-results>
                                        </esql:results>
                                </esql:execute-query>
                        </esql:connection>
                </body>
        </html>
</xsp:page>




"Alex Kovacs" <[EMAIL PROTECTED]>

03/22/2004 07:38 PM
Please respond to users

       
        To:        <[EMAIL PROTECTED]>
        cc:        
        Subject:        RE: avoid setting the password in jdbc settings in cocoon.xconf



Hi Christopher,

>
> I think the answer to both questions is, don't use database pooling :)

I understand your point

>
> If you are using ESQL, all of these can be set dynamically by using
java
> and <xsp:expr> inside the appropriate elements.  I imagine it is even
> easier in SQL transformer.  You'll have to pass in everything every
time,
> though, so you'll probably want some way to cache your user's password
in
> the session or some such, unless you have incredibly patient users...

I will try it, however it would be good to have an example of how you
define the connection for ESQL in an <xsp:expr> tag.

Thanks,
Alex


Reply via email to