Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SQL Connection Error

 
S bitz
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
This is not exactly a JDBC issue, but when i try to connect to the database using my code in java, it throws a [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
Now i did a netstat but did not find port 1433 even when the SQL Server was running.
Can anyone suggest what is the problem and how can i overcome this problem?
I am in an office LAN, is it a firewall issue?

Thanks,
Bitz
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35266
383
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bitz,
It's related enough to JDBC to stay here.

A firewall issue is likely the cause. Talking to whomever set up the firewall sounds like a useful first step.
 
S bitz
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeanne,
Well it turned out that the firewall is not ON on my system.
Is there any other reason, why the port is not listening or responding?

Thanks,
Bitz
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The SQL Server instance you are trying to connect to, is it configured to listen on 1433? Its the default so it should be, but someone might have configured it otherwise. Also is the instance configured to allow connections via TCP/IP? Again, SQL Server 2000 should allow this by default (though be aware 2005 does not)? One last thing to check - if both of the above are true, check the versions of the network dlls SQL server is using; if the instance is not properly patched TCP/IP connections can be configured to be allowed, but don't work (though we're talking very old unpatched instances of SQL Server here).

One other thing (not related to your problem, just general advice) you might consider swapping the driver you are using to the 2005 version (which works fine against 2000 versions, but isn't riddled with bugs and has proper support). Or even better, use jTDS.
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found something related with your query by google. here is link regarding this issue..
hope its helps you to reslove this.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35266
383
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by S bitz:
Well it turned out that the firewall is not ON on my system.
Is there any other reason, why the port is not listening or responding?

I was actually thinking about the firewall on the database server, not your machine. Usually a firewall is more strict about incoming connections than outgoing ones. This is similar to Paul's thought about whether the port is open.
 
S bitz
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does it have to do anything with the edition of the SQL Server installed?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by S bitz:
Does it have to do anything with the edition of the SQL Server installed?


Do you mean v6, v7, 2000, 2005 version? Or are you worried whether using the developer edition is a hinderance?

If you are worried about the version, I don't think MS offered a JDBC driver for anything earlier than 2000. There are bugs in the network dlls, if you have old versions of them (as I pointed out earlier). Other tan that both the full edition and the developer edition should work fine.
 
S bitz
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well i did not find a solution to the problem. so the admin guys uninstalled and then re-installed SQL Server Developer edition and now its working fine.
So i think maybe it was the edition that was installed. But i would really like to know why it did not work earlier? Please share any idea you have about it.

Thanks,
Bitz
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic