473,472 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

SQL Server 2000 Driver for JDBC - Error establishing sockets

30 New Member
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.ServletException: [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="text/html" import="java.sql.*" %>
<%! Connection con; Statement st; ResultSet rs; %>
<%
try
{
Class.forName("com.microsoft.jdbc.sqlserver.SQLSer verDriver");

con=DriverManager.getConnection("jdbc:microsoft:sq lserver://localhost:1433;DatabaseName=VFS","sa","");
st=con.createStatement();
rs=st.executeQuery("select * from test");
while(rs.next())
{
out.println(rs.getString(1));
}
}
catch(Exception e)
{
out.println("Error -----> "+e);
}
%>

If anybody know the answer, please post ur suggestion.



Thanks in advance.


Thanks & Regards,


V. Prasath
Sep 21 '07 #1
2 3420
gsuns82
58 New Member
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.ServletException: [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="text/html" import="java.sql.*" %>
<%! Connection con; Statement st; ResultSet rs; %>
<%
try
{
Class.forName("com.microsoft.jdbc.sqlserver.SQLSer verDriver");

con=DriverManager.getConnection("jdbc:microsoft:sq lserver://localhost:1433;DatabaseName=VFS","sa","");
st=con.createStatement();
rs=st.executeQuery("select * from test");
while(rs.next())
{
out.println(rs.getString(1));
}
}
catch(Exception e)
{
out.println("Error -----> "+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.
Sep 21 '07 #2
prasath03
30 New Member
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
Sep 22 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: JShurmatz | last post by:
If anyone can shed some light on this problem I would greatly appreciate it. I am unsuccessfully trying to use a database connnection retrieved from a pool configured using Java System Web...
10
by: Ellen K | last post by:
Anyone have any tips for using Java against SQL Server? Our IT director is thinking of making us a Java shop, but I really would like to stay with SQL Server as our RDBMS. We have Oracle...
8
by: deegs_ca | last post by:
So I had my jdbc db28.2 fix pack 9 client running because I had taken the jars from <DB2ROOT>/java folder from Enterprise Edition 8.2 fix pack 9, db2java.zip, db2jcc.zip, and the license jar. ...
1
by: Praveen | last post by:
Hi, I have installed WebSphere Portal on AIX and connected to DB2 on a remote machine, Getting the followin errors when trying to get the values from database thru applications installed on...
0
by: Wayfarer | last post by:
I loaded my Visual Studio, which includes SQL Server version 7.0. I did not encounter any error messages in the installation. It created two DSN entries: LocalServer & MQIS Unfortunately...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
1
by: doniravi | last post by:
hello sir... i m using sql server 2000 database and usig jsp to access it when accessig i am getting followig error java.sql.SQLException: Unable to connect. Invalid URL. i installed...
3
by: doniravi | last post by:
Hi all: I am trying to connect to SQL Server 2000 database using SQL Server 2005 JDBC driver. I have set the classpath for the driver as C:\Program Files\SQL Server 2005 JDBC...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.