-3
I try to connect java with Sql Server from my local machine but I get this error
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host localhost,
port 1434 has failed.
Error: Connection refused: connect. Please verify the connection properties and check that
a SQL Server instance is running on the host and accepting TCP/IP connections at the port,
and that no firewall is blocking TCP connections to the port.
My Connection Line.
Connection con = DriverManager.getConnection(
"jdbc:sqlserver://localhost:1434;databaseName=ASSERTIVA_TESTE",
"marcelo",
"0869");`
Marcelo, you are absolutely sure that SQL Server is on the port
1434? The standard is1433. The error in question has nothing to do with Java or the driver, but the server has not been found.– utluiz
Truth is door 1433 but I keep getting the same error.
– Marcelo
The problem is then in the installation or configuration of your database. Have you even installed SQL Server on your local machine? The service is initialized?
– utluiz
to work with localhost sql-server needs to have the namePipe protocol enabled in the settings, already checked there?
– Marciano.Andrade
Look at this in Sql Configuration manager and Named Pipes this active, TCP/IP is also enabled
– Marcelo
Without specifying the DB to connect?
jdbc:sqlserver://localhost;user=MyUserName;password=*****;– Anthony Accioly