Adding JNDI datasources to servicemix is documented here for 3.x:
if you're starting servicemix directly the "conf" directory will already be in your classpath, whereas if you're embedding servicemix within a servlet container you'll need to ensure the container is configured to include the "conf" directory in the classpath so servicemix can find the jndi.properties file.
Do you want to use MySQL as the persistence store in the embedded ActiveMQ? This can be configured easily and is documented here
Simply uncomment the line
<amq:journaledJDBC journalLogFiles="5" dataDirectory="../data" dataSource="#mysql-ds"/>
in your conf/activemq.xml and set the dataSource property to the #mysql-ds reference. Further down in the same file uncomment the mysql-ds bean definition and configure it properly for url, username and password.
You will also need to place the MySQL JDBC driver into lib/optional of your ServiceMix installation.
I ask my brother, how to deploy ServiceMix the following data sources? ?
Where to deploy? Can support multiple data sources吗? Supported connection
pool management? Posted the best section of the configuration of mysql and
oracle code? thanks !!
If you want to configure the underlying ActiveMQ to use JDBC for persistence (can you please confirm this?), then only one JDBC driver can be configured at a time.
Connection pooling is provided by using the Jakarta Commons DBCP library, as already configured in your activemq.xml:
<bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="com.mysql.jdbc.Driver"></property> <property name="url" value="jdbc:mysql://localhost/activemq?relaxAutoCommit=true"></property> <property name="username" value="activemq"></property> <property name="password" value="activemq"></property> <property name="maxActive" value="200"></property> <property name="poolPreparedStatements" value="true"></property> </bean>
Perhaps you also find this documentation useful. For Oracle I also suggest reading the documentation of their JDBC driver.
thank very much!!!
I have configured JNDI will, but if I create a new project to achieve a database (mysql) operation, such as: add, delete, modify, operate, how to do? ? ? Have you source it?
I see there are spagic components jdbc, how to connect and databases, and operating it?
Can give me a database operated source project?
Edited by: gaoming25 on Mar 19, 2009 3:45 AM
Do you want to use MySQL in your application level code? Well, then just resolve the driver or JDBC connection from JNDI and use it from there.
I presume you configured MySQL via Spring?
Not sure if I understand your question right though.
Thank you very much! In jndi.xml, mysql is configured to have the will, but this oracle? ? With those drivers?
However, can not be inserted into the data, you can query!
this is the Exception ：
Exception in thread "pool-3-thread-1" java.lang.AbstractMethodError: oracle.jdbc
Edited by: gaoming25 on Apr 17, 2009 2:33 AM