using sql server

Primtek6 years ago

Hello,
I installed Traccar into Windows 2008 R2 x64 systems, I changed C:\Program Files\Traccar\conf\traccar

to:

<entry key='database.driver'>com.microsoft.sqlserver.jdbc.SQLServerDriver</entry>
<entry key='database.url'>jdbc:sqlserver://10.10.10.1\DB];user=sa;password=mysecretdonthavetoknow;databaseName=TracCar;</entry>
<entry key='database.user'>sa</entry>
<entry key='database.password'>mysecretdonthavetoknow</entry>

I restarted the service..

and run localhost:8082

it wont work..
I checked to sql server but the database not created..

does it not automatically create its database and the tables?

what I missed?

thanks

Anton Tananaev6 years ago

It should create tables automatically. You need to check logs for errors. Most likely your config is incorrect or MS SQL is misconfigured.

socstur6 years ago

You have to create the database yourself.
In config you have this...

databaseName=TracCar.

So create a database called TracCar in MySQL. Traccar doesn’t do this part as far I understand.

Primtek6 years ago

strange!

<entry key='database.driver'>com.microsoft.sqlserver.jdbc.SQLServerDriver</entry>
<entry key='database.url'>jdbc:sqlserver://10.100.100.10\DB;user=sa;password=abcdef@;databaseName=TracCar;</entry>
<entry key='database.user'>sa</entry>
<entry key='database.password'>abcdef@</entry>

no firewall blocked.. because this server is also using the same database for other application..
what I missed?

INFO|6292/0|Service traccar|18-03-03 21:00:38|	at org.traccar.database.DataManager.initDatabase(DataManager.java:133)
INFO|6292/0|Service traccar|18-03-03 21:00:38|	at org.traccar.database.DataManager.<init>(DataManager.java:86)
INFO|6292/0|Service traccar|18-03-03 21:00:38|	at org.traccar.Context.init(Context.java:333)
INFO|6292/0|Service traccar|18-03-03 21:00:38|	at org.traccar.Main.main(Main.java:35)
INFO|6292/0|Service traccar|18-03-03 21:00:38|	... 6 more
INFO|6292/0|Service traccar|18-03-03 21:00:38|Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The connection to the host 10.100.100.10, named instance db failed. Error: "java.net.SocketTimeoutException: Receive timed out". Verify the server and instance names and check that no firewall is blocking UDP traffic to port 1434.  For SQL Server 2005 or later, verify that the SQL Server Browser Service is running on the host.
INFO|6292/0|Service traccar|18-03-03 21:00:38|	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:227)
INFO|6292/0|Service traccar|18-03-03 21:00:38|	at com.microsoft.sqlserver.jdbc.SQLServerConnection.getInstancePort(SQLServerConnection.java:5241)
INFO|6292/0|Service traccar|18-03-03 21:00:38|	at com.microsoft.sqlserver.jdbc.SQLServerConnection.primaryPermissionCheck(SQLServerConnection.java:1916)
INFO|6292/0|Service traccar|18-03-03 21:00:38|	at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:1669)
INFO|6292/0|Service traccar|18-03-03 21:00:38|	at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:1528)
INFO|6292/0|Service traccar|18-03-03 21:00:38|	at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:866)
INFO|6292/0|Service traccar|18-03-03 21:00:38|	at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:569)
INFO|6292/0|Service traccar|18-03-03 21:00:38|	at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:112)
INFO|6292/0|Service traccar|18-03-03 21:00:38|	at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:118)
INFO|6292/0|Service traccar|18-03-03 21:00:38|	at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:341)
INFO|6292/0|Service traccar|18-03-03 21:00:38|	at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:193)
INFO|6292/0|Service traccar|18-03-03 21:00:38|	at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:428)
INFO|6292/0|Service traccar|18-03-03 21:00:38|	at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:499)
INFO|6292/0|Service traccar|18-03-03 21:00:38|	... 12 more
INFO|wrapper|Service traccar|18-03-03 21:00:39|calling onStop
INFO|wrapper|Service traccar|18-03-03 21:00:39|Win service stop - timeout: 30000
INFO|wrapper|Service traccar|18-03-03 21:00:39|Win service wrapper.control -> stopping application
INFO|wrapper|Service traccar|18-03-03 21:00:39|Win service stop - after shutdown
INFO|wrapper|Service traccar|18-03-03 21:00:39|Win service stop - before notify
INFO|wrapper|Service traccar|18-03-03 21:00:39|Win service terminated
Primtek6 years ago

it works :)

just want to share ..

<entry key='database.url'>jdbc:sqlserver://IPADDRESS\DB:1433;databaseName=TracCar;</entry>
<entry key='database.user'>sa</entry>
<entry key='database.password'>sapassword</entry>