By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,352 Members | 1,593 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,352 IT Pros & Developers. It's quick & easy.

JDBC - connect timed out to SQL Server 2000

P: 144

i tried to connect to SQL Server 2000 on my localhost through JDBC. i used the Microsoft SQL Server JDBC Driver 2.0, i was trying to add a new Entity Class from Databases... in Netbean 6.7.1

i couldnt make it, as i got the following error

Expand|Select|Wrap|Line Numbers
  1. Unable to add connection. Cannot establish a connection to
  2. jdbc:sqlserver://localhost:1433;databaseName=Northwind using 
  3. (The TCP/IP connection 
  4. to the host localhost, port 1433 has failed. Error: "connect timed out. 
  5. Verify the connaction propoerties, check that an instance of SQL 
  6. Server is running on the host and accepting TCP/IP connections 
  7. at the port, and that no firewall is blocking TCP connections to the port.".).
i've verified through Server Network Utility the the TCP/IP protocol is enabled and is listening on port 1433. but when i run the command "netstat -an" i don't see any service listening on port 1433.

i can connect to the database server through the query analyzer though,
what's possibly wrong? has there been any issue regarding to this?

Thank you.
Oct 12 '09 #1
Share this Question
Share on Google+
1 Reply

Expert 100+
P: 2,364
Hey thesti!

Add the code in question, we recently switched to SQL 2005 from 2000. Not quick to say I know SQL Server like the back of my hands but there were times when I thought there must be a better way, I don't say that anymore.

Also, you may need credentials to connect your app to the server.

I would do some of the critical steps first. Write code that you know will work as far as a connection, so you can isolate the server being the issue.

Simple JDBC/ODBC connections with datasource:

Expand|Select|Wrap|Line Numbers
  2. sun.jdbc.odbc.JdbcOdbcDriver
  3. jdbc:odbc:Northwind
Which means you'd need to try and connect to an Access database via Administrative Tools. If you can connect, then it is not your code or the server.

Then you would try sqlserver, with creds and see...

Alternatively, you can do likewsie with sqlserver with creds on Admin Tools to keep it simple for troubleshooting (Only do this locally, if app is promoted to full blown app server jdbc/odbc datasource via Admin Tools will have unfriendly results) :-)

Post what you have for a closer look, the whole thing... catch blocks and all:-) look into your creds, you will need those, except of course if the admins near leave it all open for all to see:-)

Nov 10 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.