Skip to content
Mark Prins edited this page Feb 26, 2019 · 9 revisions

SQL Server

1. Create a user (for example: flamingo)

2. Create a database owned by this user (for example, also named flamingo)

Tomcat

4. Make sure you copy the sqljdbc7.jar to the <!TomcatDir>/lib dir

5. Setup the JNDI data source in the `GlobalNamingResources` in Tomcat server.xml as follows

<Resource name="jdbc/geo_viewer"
    auth="Container"
    type="javax.sql.DataSource"
    username="<<USERNAME>>"
    password="<<PASSWORD>>"
    driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
    url="jdbc:sqlserver://<<HOST>>;database=<<DATABASE_NAME>>;integratedSecurity=false;"
    maxActive="40"
    validationQuery="select 1"
    timeBetweenEvictionRunsMillis="30000"
    minEvictableIdleTimeMillis="5000" />	

Make sure to add the `<Resource>` element as child of the already existing `<GlobalNamingResources>` element.

Note only Microsoft SQL Server 2017 (major: 14) with Microsoft JDBC Driver 7.0 (or newer) for SQL Server (major : 7) is supported, these will show up in the log file as below:

Database ->
       name : Microsoft SQL Server
    version : 14.00.3048
      major : 14
      minor : 0
Driver ->
       name : Microsoft JDBC Driver 7.0 for SQL Server
    version : 7.0.0.0
      major : 7
      minor : 0