Error connecting to JDBC with local sql Server

-3

I try to connect the java with the 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");' 
    
asked by anonymous 28.07.2014 / 17:23

2 answers

0

Use JTDS. The Microsoft Driver is cursed and will cause you to spend a lot of time trying to configure until you quit and become frustrated, only then resolve to use JTDS.

    
29.07.2014 / 01:31
0

Marcelo,

Try the following:      Add in the rules of your Windows Firewall port 1433, to allow the exception.      Within Sql Manager Studio Enable the "Allow remote connections to This Server"      In the Configuration Manager Enter the settings with the Configuration Manager and Enter the properties of the TCP / IP protocol, under IP Addresses in the IPAll menu, enter the port in the TCP Port field.      Restart your instance's SQL Server service and try again.

 Não sei se ajudara mais fiz desta forma e funcionou corretamente.

 O tutorial que ajudou muito foi: http://sqlfromhell.wordpress.com/2010/04/18/habilitando-o-acesso-remoto-no-sql-server-2008/
    
26.08.2014 / 03:07