You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Nils Le?mann <ni...@students.uni-mannheim.de> on 2002/12/07 20:08:39 UTC
unable to connect to firebird/mysql using esql
hi folks,
i'm totally stuck trying to connect cocoon (2.0.3) to firebird.
org.apache.cocoon.ProcessingException: Exception in
ServerPagesGenerator.generate():
java.lang.RuntimeException: Could not get the datasource
org.apache.avalon.excalibur.datasource.NoValidConnectionException:
No valid JdbcConnection class available
* i'm loading the driver in web.xml, works:
DEBUG (2002-12-07) 19:43.13:516 [access] (Unknown-URI)
Unknown-thread/CocoonServlet: Trying to load class:
org.firebirdsql.jdbc.FBDriver
* i set up the connection pool in cocoon.xconf:
<jdbc name="fire">
<pool-controller min="5" max="10"/>
<dburl>jdbc:firebirdsql:localhost/3050:H:\\interbase\\firebird</dburl>
<user>sysdba</user>
<password>masterkey</password>
</jdbc>
using the very same settings in a small java programm works.
* i am using the following xsp:
<esql:connection>
<esql:pool>mysql</esql:pool>
<esql:execute-query>
<esql:query>select * from test</esql:query>
<esql:results>
<esql:row-results>
<esql:get-string column="id"/>
</esql:row-results>
</esql:results>
</esql:execute-query>
</esql:connection>
after having no success for more than a week i tried mysql and get the
same results - jdbc driver works in "normal" java enviroment, but i get
this "no jdbcConnection" message.
can anyone help me?
thank you,
nils
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: unable to connect to firebird/mysql using esql
Posted by Gal Nitzan <gn...@usa.net>.
Hi,
Following is code excerpt from my own tests and it actually works with
mysql. I will give u the whole story :-) , hope it will help.
-----------------------------------------------
In web.xml:
<!--
This parameter is used to list classes that should be loaded
at initialization time of the servlet.
Usually this classes are JDBC Drivers used
-->
<init-param>
<param-name>load-class</param-name>
<param-value>
com.mysql.jdbc.Driver
</param-value>
</init-param>
end web.xml part
--------------------------------------------------------
--------------------------------------------------------
in cocoon.xconf
<!-- Datasources: -->
<datasources>
<!-- MAKE SURE TO USE THE "NAME" PROPERTY AS THE POOL NAME IN THE ESQL
CALL-->
<jdbc logger="core.datasources.pool_name" name="pool_name">
<pool-controller max="10" min="5"/>
<auto-commit>true</auto-commit>
<dburl>jdbc:mysql://192.168.1.1/mag</dburl>
<user>username</user>
<password>password</password>
</jdbc>
</datasources>
end cocoon.xconf part
--------------------------------------------------------
--------------------------------------------------------
in my xsp page
<?xml version="1.0"?>
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
xmlns:esql="http://apache.org/cocoon/SQL/v2">
<page>
<title>title</title>
<para>
<xsp:logic>
if ( request.getParameter("doing_post") != null ) {
<esql:connection>
<esql:pool>gedcom</esql:pool>
<esql:execute-query>
<esql:query>
insert into employees (first_name, last_name, address, city,zip,
home_phone, cell_phone, office_ext, date_started, title, office_id,
remarks, email ) values (
(<esql:parameter><xsp:expr>request.getParameter("first_name")</xsp:expr></esql:parameter>),
(<esql:parameter><xsp:expr>request.getParameter("last_name")</xsp:expr></esql:parameter>),
(<esql:parameter><xsp:expr>request.getParameter("address")</xsp:expr></esql:parameter>),
(<esql:parameter><xsp:expr>request.getParameter("city")</xsp:expr></esql:parameter>),
(<esql:parameter><xsp:expr>request.getParameter("zip")</xsp:expr></esql:parameter>),
(<esql:parameter><xsp:expr>request.getParameter("home_phone")</xsp:expr></esql:parameter>),
(<esql:parameter><xsp:expr>request.getParameter("cell_phone")</xsp:expr></esql:parameter>),
(<esql:parameter><xsp:expr>request.getParameter("office_ext")</xsp:expr></esql:parameter>),
(<esql:parameter><xsp:expr>request.getParameter("date_started")</xsp:expr></esql:parameter>),
(<esql:parameter><xsp:expr>request.getParameter("title")</xsp:expr></esql:parameter>),
(<esql:parameter><xsp:expr>request.getParameter("office_id")</xsp:expr></esql:parameter>),
(<esql:parameter><xsp:expr>request.getParameter("remarks")</xsp:expr></esql:parameter>),
(<esql:parameter><xsp:expr>request.getParameter("email")</xsp:expr></esql:parameter>))
</esql:query>
<esql:error-results>An error occurred</esql:error-results>
<esql:no-results>
<p>Sorry, no results!</p>
</esql:no-results>
</esql:execute-query>
</esql:connection>
<b> OKKKKKKKKKKKKKKKKK</b>
<p>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</p>
} else {
<p align="right">
<font size="+2">add employee</font>
</p>
<table border="0" width="100%">
<tbody>
<form method="post" action="home.section">
<input type="hidden" name="doing_post" value="1" />
<tr align="right">
<td ><input type="text" name="date_started" /></td>
<td>date started</td>
<td ><input type="text" name="last_name" /></td>
<td>last name</td>
<td ><input type="text" name="first_name" /></td>
<td>first name</td>
</tr>
<tr align="right">
<td><br /><br /><input type="text" name="zip" /></td>
<td><br /><br />zip</td>
<td><br /><br /><input type="text" name="city" /></td>
<td><br /><br />city</td>
<td><br /><br /><input type="text" name="address" /></td>
<td><br /><br />address</td>
</tr>
<tr align="right">
<td><br /><br /><input type="text" name="office_ext" /></td>
<td><br /><br />office ext</td>
<td><br /><br /><input type="text" name="cell_phone" /></td>
<td><br /><br />cell phone</td>
<td><br /><br /><input type="text" name="home_phone" /></td>
<td><br /><br />home phone</td>
</tr>
<tr align="right">
<td><br /><br /><input type="text" name="title" /></td>
<td><br /><br />job title</td>
<td><br /><br /><input type="text" name="office_id" /></td>
<td><br /><br />office_id</td>
<td><br /><br /><input type="text" name="email" /></td>
<td><br /><br />email</td>
</tr>
<tr align="center">
<td colspan="6">
<br /><br /><br />
<textarea name="remarks" rows="8" cols="80"></textarea>
<br /><br />
</td>
</tr>
<tr align="center">
<td colspan="6">
<input type="reset" value=" reset " />
<input type="submit" value=" submit " />
</td>
</tr>
</form>
</tbody>
</table>
};
</xsp:logic>
</para>
</page>
</xsp:page>
end xsp page
--------------------------------------------------------
Regards,
Gal Nitzan
On Sat, 2002-12-07 at 21:08, Nils Le?mann wrote:
> hi folks,
>
> i'm totally stuck trying to connect cocoon (2.0.3) to firebird.
>
> org.apache.cocoon.ProcessingException: Exception in
> ServerPagesGenerator.generate():
>
> java.lang.RuntimeException: Could not get the datasource
>
> org.apache.avalon.excalibur.datasource.NoValidConnectionException:
> No valid JdbcConnection class available
>
> * i'm loading the driver in web.xml, works:
>
> DEBUG (2002-12-07) 19:43.13:516 [access] (Unknown-URI)
> Unknown-thread/CocoonServlet: Trying to load class:
> org.firebirdsql.jdbc.FBDriver
>
> * i set up the connection pool in cocoon.xconf:
>
> <jdbc name="fire">
> <pool-controller min="5" max="10"/>
>
> <dburl>jdbc:firebirdsql:localhost/3050:H:\\interbase\\firebird</dburl>
> <user>sysdba</user>
> <password>masterkey</password>
> </jdbc>
>
> using the very same settings in a small java programm works.
>
> * i am using the following xsp:
>
> <esql:connection>
> <esql:pool>mysql</esql:pool>
> <esql:execute-query>
> <esql:query>select * from test</esql:query>
> <esql:results>
> <esql:row-results>
> <esql:get-string column="id"/>
> </esql:row-results>
> </esql:results>
> </esql:execute-query>
> </esql:connection>
>
>
> after having no success for more than a week i tried mysql and get the
> same results - jdbc driver works in "normal" java enviroment, but i get
> this "no jdbcConnection" message.
>
> can anyone help me?
>
> thank you,
> nils
>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>