You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mustafa Yalniz <ya...@bumed.org.tr> on 2003/05/17 15:45:12 UTC

Cocoon database connection

Hi,
 
Very simple question:
 
I have a sitemap snippet as below
 
        <map:match pattern="sunrise-newuser">
          <map:generate src="vip/resources/sunrise-newuser.xml"/>
              <map:transform type="sql"/>
              <map:serialize type="xml"/>
        </map:match>
 
And an xml file as below.
 
<xsp:page language="java"
            xmlns:xsp="http://apache.org/xsp"
            xmlns:esql="http://apache.org/cocoon/SQL/v2">
 
<page>
  <esql:connection>
 
   <!-- connection information -->
   <esql:pool>vip_db</esql:pool>
 
   <esql:execute-query>
   
      <esql:query>
                        insert into user_tb (name, password, role,
title, firstname, lastname)
 
values('adminmusti','adminmusti','admin','Mr.','Mustafa','Yalniz')
      </esql:query>
 
      <esql:results/>
      <esql:no-results/>
      <esql:error-results>
            <b><esql:get-message/></b>
            <b><string><esql:to-string/></string></b><br/>
            <pre><esql:get-stacktrace/></pre>
      </esql:error-results>
      <esql:update-results>
      <p>Inserted:
      </esql:update-results>
   </esql:execute-query>
  
  </esql:connection>
</page>
</xsp:page>
 
My cocoon.xconf has below lines.
 
    <jdbc logger="core.datasources.vip_db" name="vip_db">
      <pool-controller max="10" min="5"/>
 
<dburl>jdbc:mysql://localhost:3306/vip_db?autoReconnect=true</dburl>
      <user>username</user>
      <password>password</password>
    </jdbc>
 
And when I browse this page this does not connect to the database at
all. Any idea about what I am doing wrong.
 
Thanks,
Mustafa

Re: Cocoon database connection

Posted by Mustafa Yalniz <ya...@bumed.org.tr>.
Hi Antonio,

I have found the problem. It was illegal --> while commenting out the
unused xml snippet. I have just realized this. And your correction.

Thanks for the info.
Mustafa



-----Özgün İleti-----
Kimden: Antonio Gallardo [mailto:agallardo@agsoftware.dnsalias.com] 
Tarih: 17 Mayıs 2003 Cumartesi 16:47
Kime: cocoon-users@xml.apache.org
Konu: Re: Cocoon database connection

Hi!

I read the your mail, but I dont understand what are you trying to do.
Your XSP page needs to be generated using the XSP generator. Then there
is
no need of using the SQL tranformer.

Here is an error that can prevent the total execution:

<p>Inserted:

This line must be:

<p>Inserted:</p>

Please note I am just guessing what are you trying to do. Of course I
know
you are trying to insert a register into the database.

I recommend you to check the logs into the directory:

/webapps/your_application/WEB-INF/logs

Best Regards,

Antonio Gallardo.



Mustafa Yalniz dijo:
> Hi,
>
> Very simple question:
>
> I have a sitemap snippet as below
>
>         <map:match pattern="sunrise-newuser">
>           <map:generate src="vip/resources/sunrise-newuser.xml"/>
>               <map:transform type="sql"/>
>               <map:serialize type="xml"/>
>         </map:match>
>
> And an xml file as below.
>
> <xsp:page language="java"
>             xmlns:xsp="http://apache.org/xsp"
>             xmlns:esql="http://apache.org/cocoon/SQL/v2">
>
> <page>
>   <esql:connection>
>
>    <!-- connection information -->
>    <esql:pool>vip_db</esql:pool>
>
>    <esql:execute-query>
>
>       <esql:query>
>                         insert into user_tb (name, password, role,
> title, firstname, lastname)
>
> values('adminmusti','adminmusti','admin','Mr.','Mustafa','Yalniz')
>       </esql:query>
>
>       <esql:results/>
>       <esql:no-results/>
>       <esql:error-results>
>             <b><esql:get-message/></b>
>             <b><string><esql:to-string/></string></b><br/>
>             <pre><esql:get-stacktrace/></pre>
>       </esql:error-results>
>       <esql:update-results>
>       <p>Inserted:
>       </esql:update-results>
>    </esql:execute-query>
>
>   </esql:connection>
> </page>
> </xsp:page>
>
> My cocoon.xconf has below lines.
>
>     <jdbc logger="core.datasources.vip_db" name="vip_db">
>       <pool-controller max="10" min="5"/>
>
> <dburl>jdbc:mysql://localhost:3306/vip_db?autoReconnect=true</dburl>
>       <user>username</user>
>       <password>password</password>
>     </jdbc>
>
> And when I browse this page this does not connect to the database at
> all. Any idea about what I am doing wrong.
>
> Thanks,
> Mustafa




---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Cocoon database connection

Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Hi!

I read the your mail, but I dont understand what are you trying to do.
Your XSP page needs to be generated using the XSP generator. Then there is
no need of using the SQL tranformer.

Here is an error that can prevent the total execution:

<p>Inserted:

This line must be:

<p>Inserted:</p>

Please note I am just guessing what are you trying to do. Of course I know
you are trying to insert a register into the database.

I recommend you to check the logs into the directory:

/webapps/your_application/WEB-INF/logs

Best Regards,

Antonio Gallardo.



Mustafa Yalniz dijo:
> Hi,
>
> Very simple question:
>
> I have a sitemap snippet as below
>
>         <map:match pattern="sunrise-newuser">
>           <map:generate src="vip/resources/sunrise-newuser.xml"/>
>               <map:transform type="sql"/>
>               <map:serialize type="xml"/>
>         </map:match>
>
> And an xml file as below.
>
> <xsp:page language="java"
>             xmlns:xsp="http://apache.org/xsp"
>             xmlns:esql="http://apache.org/cocoon/SQL/v2">
>
> <page>
>   <esql:connection>
>
>    <!-- connection information -->
>    <esql:pool>vip_db</esql:pool>
>
>    <esql:execute-query>
>
>       <esql:query>
>                         insert into user_tb (name, password, role,
> title, firstname, lastname)
>
> values('adminmusti','adminmusti','admin','Mr.','Mustafa','Yalniz')
>       </esql:query>
>
>       <esql:results/>
>       <esql:no-results/>
>       <esql:error-results>
>             <b><esql:get-message/></b>
>             <b><string><esql:to-string/></string></b><br/>
>             <pre><esql:get-stacktrace/></pre>
>       </esql:error-results>
>       <esql:update-results>
>       <p>Inserted:
>       </esql:update-results>
>    </esql:execute-query>
>
>   </esql:connection>
> </page>
> </xsp:page>
>
> My cocoon.xconf has below lines.
>
>     <jdbc logger="core.datasources.vip_db" name="vip_db">
>       <pool-controller max="10" min="5"/>
>
> <dburl>jdbc:mysql://localhost:3306/vip_db?autoReconnect=true</dburl>
>       <user>username</user>
>       <password>password</password>
>     </jdbc>
>
> And when I browse this page this does not connect to the database at
> all. Any idea about what I am doing wrong.
>
> Thanks,
> Mustafa




---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org