Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi I want to connect to sqlserver 2000
I Use Netbean IDE .
I add msbase.jar,mssqlserver.jar,msutil.jar to driver
when I want to add Connection
JDBC URL = "jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=Northwind;"

but it doesn't connect .The error is : "Error establishing socket"
I check in server network utility , TCP/IP is in Enable protocols list ,and the port number is 1433
I turn off the windows firewall
but still now I have this error

I also use jdbc.jar and it connects to sql server 2008 . but it can't connect to sql server 2000 with jdbc either.
what could I do?

error is :
"com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: connect"
Posted
Updated 9-Jan-12 20:42pm
v10
Comments
Richard MacCutchan 9-Jan-12 6:02am    
Are you saying that you have SQL Server 2000 and SQL Server 2008 both running on your local system, and using the same port number?
Mahnoosh_M 9-Jan-12 6:03am    
in the same system ,, but not same port number
sql server 2000 port number is 1433
and sql 2008 port number is 1037

The connection string for SQL Server 2000 should be something like:
jdbc:microsoft:sqlserver://localhost:1433;user=mahnoosh;password=wibbleHatStand

You can't use the DatabaseName attribute as far as I know.
 
Share this answer
 
Thanks all
I use "sun.jdbc.odbc.JdbcOdbcDriver"
and it works
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900