Conexão com SQL Server

1 resposta
G

Olá Amigos
Gostaaria da ajuda de vocês, o seguinte erro >> java.sql.SQLException: Network error IOException: Connection refused: connect, acontece quando tento conectar com o SQL Server usando o drive jtds.

Veja código fonte:

<%<a class="mention" href="/u/page">@page</a> import=“java.sql.*”%>

<html>

<head><title>Resultado</title></head>

<body>
<%

Connection conn = null;

Statement stmt = null;

ResultSet rset = null;
// Verificando se o driver JDBC está instalado e pode ser utilizado

try

{

Class.forName(net.sourceforge.jtds.jdbc.Driver);

}

catch (java.lang.ClassNotFoundException e)

{

System.err.print("ClassNotFoundException: ");

System.err.println(e.getMessage());

}
// Conectando no banco de dados e realizando a consulta

try

{

String url = jdbc:jtds:sqlserver://C132:1433/DADOSTCC”;

conn = DriverManager.getConnection(url,"","");

stmt = conn.createStatement();

}

catch(SQLException e)

{

out.println(e);

}

%>

</body>
</html>

OBRIGADO GALERA

1 Resposta

R

pode ser erro na tua url, verifique se esta tudo em ordem de acordo com as informações do teu banco

Criado 28 de julho de 2005
Ultima resposta 28 de jul. de 2005
Respostas 1
Participantes 2