I created a Java program (java 6) that uses a JDBC connector (sqljdbc4.jar) to connect to SQLServer (Express) on another server. The program runs fine when it runs it on my development laptop (started from Eclipse). When I deploy the program to another computer it does not work. When I start it, as soon as it tries to get results from the database (exactly the same database), nothing happens anymore.
Checked the database, queried on sys.sysprocesses. I see one process (for my application) but not blocking. I see some strange things there, hostprocess is 0 (all other enries have a number there and net_address is 000000000000 all other enties have a hexadecimale number, sql_handle also 0, all entries have a number there.
If I kill this process in the database, then the program continues working (with an error message about a connection reset).
So why does it work from one computer and not from another.
Yes, indeed. A stack trace would be the thing to look at. Otherwise the problem could be almost anything -- you didn't deploy the driver jar along with the application, you didn't put it in the right place, you wrote your code to connect to the database via "localhost", you have a firewall blocking communication -- the list is endless.
Joined: Jan 12, 2012
the problem is there are no messages.
To isolate the problem, I created a runnable jar. If I execute it from my laptop it works fine, which means I just test if I can make a connection.
If I copy the Jar to my production server and start it, it just hangs. On the database I can see a process then and if I kill that process I just get a Connection Reset error message in my application.
Tested it from yet another computer and it works fine again.
Joined: Jan 12, 2012
tested my app on various computers. Noticed that only computers with java version 1.6.0_29 did not work. Lower versions and higher versions work well. After upgrade 1.6.0_29 computers to 1.6.0_30 they work well too.
subject: cannot connect to MS SQLServer from other computer