we have strange issue. We wrote a Java program that is using JDBC to update and insert data into a SQL Anywhere 16 db running on the same local Windows Server 2008 RT2 as the program itself.
This program should run scheduled every hour - for that, we used the Windows Task Scheduler and created a job there.
When we execute the program on the command line, it works perfectly. However when the task scheduler starts it, Java can not find the server and it runs into an exception:
This is our connection string: jdbc:sqlanywhere:Server=geaodb;DBN=geaodb;UID=;PWD=;LINKS=TCPIP,SHMEM
We played around with the connection string, but nothing changed this behaviour.
Did anyone else encountered such an issue? Any idea how to solve this?
Thanks for your help and best regards, Alex
asked 19 Jan '16, 09:46
Is the database server running as a service or running in a foreground session?
If you are running the JDBC client in session 0 as local system, it won't be able to connect over shared memory to a database server running in a regular user session.
Running the database engine/server as a service should allow the connection over shared memory connection to succeed.
Alternatively, you could connect over TCPIP by ensuring LINKS=TCPIP is in the connection string and the server (dbsrv16) not the engine (dbeng16) is being used. This should work regardless of what session the client and server are running in.