Microsoft SQL Server

By default Traccar Server uses embedded H2 database. If you want to use Microsoft SQL Server database engine instead you need to change Traccar configuration.

Configuration change

Replace following lines in default configuration:

<entry key='database.driver'>org.h2.Driver</entry>
<entry key='database.url'>jdbc:h2:/home/user/Documents/traccar/target/database</entry>
<entry key='database.user'>sa</entry>
<entry key='database.password'></entry>

With configuration parameters for Microsoft SQL Server:

<entry key='database.driver'>com.microsoft.sqlserver.jdbc.SQLServerDriver</entry>
<entry key='database.url'>jdbc:sqlserver://[serverName][\instanceName];user=[userName];password=[password];databaseName=[database];</entry>
<entry key='database.user'>[userName]</entry>
<entry key='database.password'>[password]</entry>

Where:

Troubleshooting

If you get "the statement must be executed before any results" error, try adding "; SELECT SCOPE_IDENTITY()" at the end of every INSERT query in the config.