blob: 7637673ee402ff3d25a86344f56ba863176caddb [file] [log] [blame]
<div class="wiki-content maincontent">
<p>ActiveMQ explicity supports Derby, Axion, HSQL, Oracle, and SQLServer. Below are the steps on how to configure a new database.</p>
<p>1. Modify activemq.xml found in the directory "activemq_home/conf" by editing or adding a JDBC DataSource Configuration.</p>
<p>e.g.</p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
&lt;bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"&gt;
&lt;property name="driverClassName" value="com.mysql.jdbc.Driver"/&gt;
&lt;property name="url" value="jdbc:mysql://localhost/activemq"/&gt;
&lt;property name="username" value="activemq"/&gt;
&lt;property name="password" value="activemq"/&gt;
&lt;property name="poolPreparedStatements" value="true"/&gt;
&lt;/bean&gt;
</pre>
</div></div>
<p><strong>For AMQ 3.x</strong></p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
&lt;bean id="mssql-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"&gt;
&lt;property name="driverClassName"&gt;
&lt;value&gt;com.microsoft.jdbc.sqlserver.SQLServerDriver&lt;/value&gt;
&lt;/property&gt;
&lt;property name="url"&gt;
&lt;value&gt;jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=activedb&lt;/value&gt;
&lt;/property&gt;
&lt;property name="username"&gt;
&lt;value&gt;sa&lt;/value&gt;
&lt;/property&gt;
&lt;property name="password"&gt;
&lt;value&gt;&lt;/value&gt;
&lt;/property&gt;
&lt;property name="poolPreparedStatements"&gt;
&lt;value&gt;true&lt;/value&gt;
&lt;/property&gt;
&lt;/bean&gt;
</pre>
</div></div>
<p>2. Set the datasource reference to use the new jdbc configuration e.g &lt;jdbcPersistence dataSourceRef="mssql-ds"/&gt;</p>
<p>3. Place the jdbc driver in the directory "activemq_home/lib/optional".</p></div>