You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Bruce Snyder <br...@gmail.com> on 2007/05/26 16:45:22 UTC

Re: configuring mysql persistant adapter

On 5/25/07, Vinod_mit <vi...@gmail.com> wrote:
>
> Hi friends
> iam trying to connect mysql with acitvemq here is my code
>
>     <persistenceAdapter>
>
>       <journaledJDBC dataSource="#mysql-ds"/>
>
>     </persistenceAdapter>
>
> and here is the description, i have copied
> mysql-connector-java-5.0.5-bin.jar in activemq lib directory
> here is my mysql
>
>     <bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource"
> destroy-method="close">
>     <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
>     <property name="url"
> value="jdbc:mysql://localhost/activemq?relaxAutoCommit=true"/>
>     <property name="username" value=""/>
>     <property name="password" value=""/>
>     <property name="poolPreparedStatements" value="true"/>
>   </bean>
>
> when i start activemq i get these errors
>
> Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create
> PoolableCon
> nectionFactory (Communications link failure due to underlying exception:
>
> can any one tell me what is the problem.
> or u can mail me : vinu.mm@gmail.com

I'd try to use another pooler like c3p0 to make sure it's not an issue
with DBCP. Below is an example configuration for it:

<bean id="mysql-ds" class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close">
  <property name="driverClass" value="com.mysql.jdbc.Driver">
  <property name="jdbcUrl" value="jdbc:mysql://localhost:3306">
  <property name="user" value="user">
  <property name="password" value="pass">
  <property name="minPoolSize" value="5">
  <property name="maxPoolSize" value="10">
  <property name="acquireIncrement" value="3">
</bean>

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Castor - http://castor.org/