Ola a todos estou tanando me conectar ao sql Server só que recebo a seguinte mensagem de error:
set 23, 2016 11:17:37 AM com.microsoft.sqlserver.jdbc.SQLServerConnection Prelogin
ADVERTÊNCIA: ConnectionID:1 Prelogin error: host srvwin2012 port 49154 Unexpected end of prelogin response after 0 bytes read
Exception in thread “main” com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host srvwin2012, port 49154 has failed. Error: The driver received an unexpected prelogin response. 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. Note that this driver can be used only with SQL Server 2000 or later…
at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1509)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.Prelogin(SQLServerConnection.java:1297)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1200)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(SQLServerConnection.java:1054)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:758)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:842)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at db.connections.SQL_ServerConnerction.abreConexao(SQL_ServerConnerction.java:45)
at sc.classes.Teste.conexão(Teste.java:22)
at sc.classes.Teste.main(Teste.java:27)
Java Result: 1
Meu método de conexão:
public static Connection abreConexao() throws SQLException{
try
{
Class.forName(DRIVER );
Connection con = DriverManager.getConnection(URL,usuario,password);
return con;
} catch (ClassNotFoundException e) {
throw new SQLException(e.getMessage());
}
}
os parâmetros que passo para conexão ja chequei e estão corretos se alguém puder me ajudar fico grato