<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Set up JBPM5.4 Final Installer to use MS SQL Server 2008 using JTDS
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/thomas.setiabudi">Thomas Setiabudi</a> in <i>jBPM</i> - <a href="https://community.jboss.org/docs/DOC-47975">View the full document</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p><div class="toc" style="border: 1px dashed black; padding: 10px;"><ul><li>
<a class="jive-link-anchor-small" href="#A_What_I_Am_Going_To_Do">A. What I Am Going To Do</a>
</li>
<li>
<a class="jive-link-anchor-small" href="#B_The_Setup_Steps">B. The Setup Steps</a>
</li>
</ul></div></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I have been using JBPM5.3 for some months and then I switch to JBPM5.4. </p><p><span>After I download JBPM5.4.Final full installer, I thought the DB Set up will be exactly the same with JBPM5.3 full installer </span><a class="jive-link-external-small" href="https://community.jboss.org/docs/DOC-19221" target="_blank">https://community.jboss.org/wiki/SetUpJBPM53ToUseMSSQLServer2008</a></p><p><span>But I realized that some things has changed and at the time when I write this, the guide for changing Database in JBPM5.4 full installer is still outdated </span><a class="jive-link-external-small" href="http://docs.jboss.org/jbpm/v5.4/userguide/ch.installer.html#d0e609" target="_blank">http://docs.jboss.org/jbpm/v5.4/userguide/ch.installer.html#d0e609</a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><h1 id="A_What_I_Am_Going_To_Do">A. What I Am Going To Do</h1><p>&#160;&#160;&#160;&#160; 1. I will change the Database setting of jbpm5.4 final full installer and point it to use MS SQL Server 2008</p><p>&#160;&#160;&#160;&#160; 2. The Database driver used is jtds-1.2.4</p><p>&#160;&#160;&#160;&#160; 3. Although it is possible to have separate database for Task and Process data, in this setup I will use only one Database for all the Task database tables and all the Process database tables.</p><p>&#160;&#160;&#160;&#160; 4. I do this set up using Windows XP 64 Bit</p><p>&#160;&#160;&#160;&#160; 5. apache ant version used is Apache Ant 1.8.4</p><p>&#160;&#160;&#160;&#160; 6. jdk used is jdk 1.6 (set in Windows Environment variable as JAVA_HOME)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><h1 id="B_The_Setup_Steps">B. The Setup Steps</h1><p>1. JBPM5.4 final full installer comes with almost every needed component, except eclipse (optional). But I want the eclipse, so I download <strong>eclipse-java-helios-SR2-win32-x86_64.zip</strong> and put it into </p><p>&#160;&#160;&#160;&#160; <strong>jbpm-installer\lib</strong> folder</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>2. Because my OS is 64 bit version, I have to do a modification to the <strong>build.xml</strong> file found in <strong>jbpm-installer</strong> folder. So I changed this part </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-comment">&lt;!-- Download Eclipse --&gt;</span>
&#160; <span class="jive-xml-tag">&lt;condition property="download.type" value="win32"&gt;</span>
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;os family="windows" /&gt;</span>
&#160; <span class="jive-xml-tag">&lt;/condition&gt;</span> 
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>to</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-comment">&lt;!-- Download Eclipse --&gt;</span>
&#160; <span class="jive-xml-tag">&lt;condition property="download.type" value="win32-x86_64"&gt;</span>
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;os family="windows" /&gt;</span>
&#160; <span class="jive-xml-tag">&lt;/condition&gt;</span>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>3. Now its time to set up the Hibernate settings, mostly we will make changes to the hibernate dialect, lets open <strong>jbpm-installer\db </strong>folder.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>4. I am not sure how each file is used here in jbpm5.4 since the official guide still reflect jbpm5.3 files, so here is what I do, I start with opening <strong>jbpm-installer\db</strong>\<strong>jbpm-persistence-JPA1.xml</strong></p><p>I changed:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag">&lt;properties&gt;</span>
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/&gt;</span>
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="hibernate.max_fetch_depth" value="3"/&gt;</span>

</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>to</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag">&lt;properties&gt;</span>
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/&gt;</span>
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="hibernate.max_fetch_depth" value="3"/&gt;</span>

</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>5. Then I open <strong>jbpm-installer\db</strong>\<strong>jbpm-persistence-JPA2.xml</strong></p><p>I changed:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-xml"> <span class="jive-xml-tag">&lt;properties&gt;</span>
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" /&gt;</span>
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="hibernate.max_fetch_depth" value="3" /&gt;</span>

</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>to</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-xml"> <span class="jive-xml-tag">&lt;properties&gt;</span>
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect" /&gt;</span>
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="hibernate.max_fetch_depth" value="3" /&gt;</span>

</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>6. Lets continue, and open <strong>jbpm-installer\db\task-persistence-JPA1.xml</strong></p><p>I changed:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag">&lt;properties&gt;</span>
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/&gt;</span>
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="hibernate.connection.driver_class" value="org.h2.Driver"/&gt;</span>
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="hibernate.connection.url" value="jdbc:h2:tcp://localhost/runtime/task" /&gt;</span>
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="hibernate.connection.username" value="sa"/&gt;</span>
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="hibernate.connection.password" value=""/&gt;</span>

</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>to</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag">&lt;properties&gt;</span>
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/&gt;</span>
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="hibernate.connection.driver_class" value="net.sourceforge.jtds.jdbc.Driver"/&gt;</span>
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="hibernate.connection.url" value="jdbc:jtds:sqlserver://DBName:1433/MyJBPMDB" /&gt;</span>
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="hibernate.connection.username" value="myuser"/&gt;</span>
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="hibernate.connection.password" value="mypassword"/&gt;</span>

</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>7. Open <strong>jbpm-installer\db\task-persistence-JPA2.xml</strong></p><p>I changed:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-xml"> <span class="jive-xml-tag">&lt;properties&gt;</span>
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/&gt;</span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="hibernate.max_fetch_depth" value="3"/&gt;</span>

</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>to</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-xml"> <span class="jive-xml-tag">&lt;properties&gt;</span>
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/&gt;</span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="hibernate.max_fetch_depth" value="3"/&gt;</span>

</code></pre></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Comment by <a href="https://community.jboss.org/docs/DOC-47975">going to Community</a></p>

        <p style="margin: 0;">Create a new document in jBPM at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=102&containerType=14&container=2034">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>