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
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
Comment