Caro colegas como configurar o netbeans para conectar com o SQL2005
qual porta, host, intance name etc
Senhores estou com esse debug, alguém pode me auxiliar!
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host localhost, port 1433 has failed. Error: “Connection refused: connect. Verify the connection properties, check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.”.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:170)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1049)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:833)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:716)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:841)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at Connect.main(Connect.java:13)
CONSTRUÍDO COM SUCESSO (tempo total: 20 segundos)
Cara esse link não abre!
quando postei funcionava e neste momento funcionou. Verifique suas configuracoes de proxy e firewall
public class ConnectionFactory {
public static Connection getConnection()throws SQLException{
try{
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
return DriverManager.getConnection("jdbc:sqlserver://localhost:1026;databaseName=estudo;user=sa;password=celera");
}catch(ClassNotFoundException e){
throw new SQLException(e.getMessage());
}
}
}
olha pessoal ao invés de ser a porta 1433, o meu sql estava com a porta 1026, esse era o problema!!, para aquele que estiverem com o mesmo problema taí a solução falou!!