• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

cannot connect to MS SQLServer from other computer

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 530
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's hard for me to tell where the problem might be at, without any errors/exceptions detailed.
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic