The Artima Developer Community
Sponsored Link

Web Services Forum
Connection to SQL Server 2000 with JDBC 4.0

1 reply on 1 page. Most recent reply: Mar 16, 2010 7:24 AM by Alex Nazarov

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Alex Nazarov

Posts: 2
Nickname: san4o
Registered: Mar, 2010

Connection to SQL Server 2000 with JDBC 4.0 Posted: Mar 16, 2010 7:23 AM
Reply to this message Reply
Advertisement
Hello everybody

I had maded:
My operation system is Windows XP
Instal SQL Server 2000, JRE 6.0, JDK 6, JDBC 4.0.
Servlet's works fine.
I create servlet, which connect to server with using JDBC.
servlet's cod:

public class database2 extends HttpServlet {
public void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=Windows-1251");
PrintWriter out = response.getWriter();
String url="jdbc:sqlserver://COMP;user=San4o;password=";
out.println("1...<BR>") ;
try {

Connection con=DriverManager.getConnection(url);
out.println("Connection ready...");

con.close();
}
catch (SQLException e2) {
out.println("exc2...<BR>");
out.println(e2.toString());
}
catch (Exception e3) {
out.println(e3.toString());
}
}
}
...
in Server Manager server - COMP start
server COMP has login - sa and password - asd123
in Server Network Utility in properties of TCP/IP default port is 1433
When i run my servlet, i get message :

com.microsoft.sqlserver.jdbc.SQLServerException: Не удалось установить соединение TCP/IP к серверу COMP по порту 1433. Ошибка: "Connection refused: connect. Проверьте свойства соединения, убедитесь, что на узле работает экземпляр SQL Server и принимает соединения TCP/IP по нужному порту, а брандмауэр не блокирует TCP-соединения по этому порту.".


Alex Nazarov

Posts: 2
Nickname: san4o
Registered: Mar, 2010

Re: Connection to SQL Server 2000 with JDBC 4.0 Posted: Mar 16, 2010 7:24 AM
Reply to this message Reply
How does correct this error?

Flat View: This topic has 1 reply on 1 page
Topic: How to do session tracking in JSP Previous Topic   Next Topic Topic: Code for calculator as our designed usercontrol in Vb.net

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use