Skip to content

Commit

Permalink
added docu for mssql
Browse files Browse the repository at this point in the history
  • Loading branch information
rsoika committed Aug 28, 2024
1 parent 112f312 commit d9c5d0e
Show file tree
Hide file tree
Showing 2 changed files with 126 additions and 0 deletions.
125 changes: 125 additions & 0 deletions src/site/markdown/install/mssql.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# How to Run Imixs-Office-Workflow with Microsoft SQL Server

Imixs-Office-Workflow can be used with databases from different vendors. In the default configuration, a PostgreSQL database is used.
The following section shows how to connect the Imixs Office workflow running under Wildfly with a Microsodft SQL Server.

## Install the Driver Module

First you need to ensure that you have configured a driver module. Create the following directory structure

```
├── modules
│   └── com
│   └── microsoft
│   └── sqlserver
│   └── jdbc
│   └── main
│   ├── module.xml
│   └── mssql-jdbc-12.8.1.jre11.jar
```

The `/main` directory includes the mssql jdbc driver and a module.xml file with the following content:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.6" name="com.microsoft.sqlserver.jdbc">
<resources>
<resource-root path="mssql-jdbc-12.8.1.jre11.jar" />
<!-- Make sure this matches the name of the JAR you are installing -->
</resources>
</module>
```

Now you can add the Driver together with the datasource configuration for Imixs-Office-Workflow into your standalone.xml file from Wildfly:

```xml
....
<subsystem xmlns="urn:jboss:domain:datasources:7.0">
<datasources>
....
<!-- imixs-workflow datasource -->
<datasource jta="true" jndi-name="java:/jdbc/office" pool-name="office"
enabled="true" use-ccm="true">
<connection-url>${env.MSSQL_CONNECTION}</connection-url>
<driver>mssql</driver>
<driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
<security>
<user-name>${env.MSSQL_USER}</user-name>
<password>${env.MSSQL_PASSWORD}</password>
</security>
<validation>
<check-valid-connection-sql>select 1</check-valid-connection-sql>
</validation>
</datasource>

<drivers>
....
<!-- MSSQL Integration-->
<driver name="mssql"
module="com.microsoft.sqlserver.jdbc">
<driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
</driver>
</drivers>
</datasources>
.....

```


The datasource is connected with the installed JDBC driver and uses environment variables to connect to your MS SQL server.
Here is an example how to configure the datasource in your `docker-compose.yaml` file:

```
version: "3.6"
services:
db:
image: mcr.microsoft.com/mssql/server:2022-preview-ubuntu-22.04
environment:
ACCEPT_EULA: "Y"
MSSQL_SA_PASSWORD: "yourStrong12345Password"
volumes:
- dbdata:/var/lib/mssql/data
app:
image: imixs/imixs-documents:2.1.0
depends_on:
- db
environment:
MSSQL_CONNECTION: "jdbc:sqlserver://db:1433;databaseName=office;encrypt=true;trustServerCertificate=true"
MSSQL_USER: "sa"
MSSQL_PASSWORD: "yourStrong12345Password"
TZ: "Europe/Berlin"
ports:
- "8080:8080"
- "8787:8787"
volumes:
- ./docker/configuration/standalone-mssql.xml:/opt/jboss/wildfly/standalone/configuration/standalone.xml
- ./docker/configuration/modules/com/microsoft/:/opt/jboss/wildfly/modules/com/microsoft/
```

We use the volumes mapping here to inject the modules and standalone.xml file into the container.


## Setup Microsoft SQL Server

In this example we use a preview version of Microsoft SQL running in a container.
You can test your Microsoft SLQ Server and create the database `office` using commandline tool `sqlcmd`

```
$ docker exec -it office-goslar-db-1 /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P yourStrong12345Password
```

From the commandline shell you can create the database with:

```
1> CREATE DATABASE office
2> GO
```

Now you can start Imixs-Office-Workflow connecting to your local Microsoft SQL Server.

In general we recommend to use a Open Source Database instead of the proprietary Microsoft SQL Server.


1 change: 1 addition & 0 deletions src/site/site.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<item name="Minikube" href="install/minikube.html" />
<item name="K3S" href="install/k3s.html" />
<item name="Lucene" href="lucene.html" />
<item name="MSSQL" href="mssql.html" />
</item>
<item name="Collabora" href="collabora/overview.html" collapse="true">
<item name="WOPI" href="collabora/wopi.html" />
Expand Down

0 comments on commit d9c5d0e

Please sign in to comment.