Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cannot connect to MS SQLServer from other computer

 
bertin kiek
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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.

Regards Bertin
 
Nam Ha Minh
Ranch Hand
Posts: 504
Eclipse IDE Firefox Browser Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's hard for me to tell where the problem might be at, without any errors/exceptions detailed.
 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
bertin kiek
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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.

Regards Bertin

 
bertin kiek
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Solved,

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.

Regards Bertin
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic