SQL Server 2000 Driver for JDBC - Error establishing sockets

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • prasath03
    New Member
    • Jun 2007
    • 30

    SQL Server 2000 Driver for JDBC - Error establishing sockets

    Hi,

    I am using Microsoft SQL Server 2000 Driver for JDBC to connect to SQL Sever 2000. It is just a test application whether its connect or not. But I got the following errors:

    Error is:
    javax.servlet.S ervletException : [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.


    I installed the windows xp sp2, jdk5 and tomcat 4.I have already tried the all posibilities like Server Network Utility, Firewall and etc.

    Here is my code:

    <%@ page language="java" contentType="te xt/html" import="java.sq l.*" %>
    <%! Connection con; Statement st; ResultSet rs; %>
    <%
    try
    {
    Class.forName(" com.microsoft.j dbc.sqlserver.S QLServerDriver" );

    con=DriverManag er.getConnectio n("jdbc:microso ft:sqlserver://localhost:1433; DatabaseName=VF S","sa","");
    st=con.createSt atement();
    rs=st.executeQu ery("select * from test");
    while(rs.next() )
    {
    out.println(rs. getString(1));
    }
    }
    catch(Exception e)
    {
    out.println("Er ror -----> "+e);
    }
    %>

    If anybody know the answer, please post ur suggestion.



    Thanks in advance.


    Thanks & Regards,


    V. Prasath
  • gsuns82
    New Member
    • Mar 2007
    • 58

    #2
    Originally posted by prasath03
    Hi,

    I am using Microsoft SQL Server 2000 Driver for JDBC to connect to SQL Sever 2000. It is just a test application whether its connect or not. But I got the following errors:

    Error is:
    javax.servlet.S ervletException : [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.


    I installed the windows xp sp2, jdk5 and tomcat 4.I have already tried the all posibilities like Server Network Utility, Firewall and etc.

    Here is my code:

    <%@ page language="java" contentType="te xt/html" import="java.sq l.*" %>
    <%! Connection con; Statement st; ResultSet rs; %>
    <%
    try
    {
    Class.forName(" com.microsoft.j dbc.sqlserver.S QLServerDriver" );

    con=DriverManag er.getConnectio n("jdbc:microso ft:sqlserver://localhost:1433; DatabaseName=VF S","sa","");
    st=con.createSt atement();
    rs=st.executeQu ery("select * from test");
    while(rs.next() )
    {
    out.println(rs. getString(1));
    }
    }
    catch(Exception e)
    {
    out.println("Er ror -----> "+e);
    }
    %>

    If anybody know the answer, please post ur suggestion.



    Thanks in advance.


    Thanks & Regards,


    V. Prasath
    Enable the Tcp/Ip protocol in sql server settings and restart sql server,if its not working after this stuffs,try to reinstall ur sql server,make sure tat u enable Tcp/Ip settings while installing.

    Thanks&Regards,
    Sundar.

    Comment

    • prasath03
      New Member
      • Jun 2007
      • 30

      #3
      Enable the Tcp/Ip protocol in sql server settings and restart sql server,if its not working after this stuffs,try to reinstall ur sql server,make sure tat u enable Tcp/Ip settings while installing.

      Thanks&Regards,
      Sundar


      Thanks for your reply...

      Where to enable the tcp/ip protocol in sql server you mean Server Network Utility, i have already tried all possibilities including uninstall and reinstall.
      How to enable the tcp/ip when I install the sql server 2000?


      Thanks & Regards,

      V. Prasath

      Comment

      Working...