Hi
Thank you for helping me, but I am still stuck with same problem.
I tried netstat command; but it does not list or show port no 1433 which suppose to be default for MS SQL Server 2000. I was not able to locate the SQL server port from the list; but did I try several different ports from the netstat list; none worked! Out put of netstat �ab is shown in the end.
********************************************************
So I change to MS SQL 2000 Driver for JDBC again.
I set Class Path to:
.;c:\program files\Microsoft SQL Server 2000 Driver for JDBC\lib\mssqlserver.jar;c:\program files\Microsoft SQL Server 2000 Driver for JDBC\lib\msbase.jar;c:\program files\Microsoft SQL Server 2000 Driver for JDBC\lib\msutil.jar;C:\WINDOWS\system32\QTJava.zip
(Included all three jar files)
*********************************************************
JDBC Driver Name: com.microsoft.jdbc.sqlserver.SQLServerDriver
URL : �jdbc:microsoft:sqlserver://127.0.0.1:1026;User=sa;Password=�
(I�ve not mentioned the password here)
**********************************************************
Test Code was:
import java.sql.*;
import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.io.*;
public class test1
{
public static void main(String[] args)
{
try
{ Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
Connection conn = DiverManager.getConnection("jdbc:microsoft:sqlserver://127.0.0.1:1026;User=sa;Password= ");
}
catch(Exception e)
{System.out.println(e);
e.printStackTrace();
}
}}
On JDK1.5:
I�ve compiled the code> javac test1.java
Run > java test1
Out put was:
*********************************************************************
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establi
hing socket.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Sourc
)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSConnection.<init>(Unknown Source
at com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown So
rce)
at com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown
ource)
at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source)
at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:193)
at test1.main(test1.java:17)
*************************************************************
OutPut for netstat �ab
Active Connections
Proto Local Address Foreign Address State PID
TCP ajit-09a2e2cg34:epmap 0.0.0.0:0 LISTENING 1008
c:\windows\system32\WS2_32.dll
C:\WINDOWS\system32\RPCRT4.dll
c:\windows\system32\rpcss.dll
C:\WINDOWS\system32\svchost.exe
-- unknown component(s) --
[svchost.exe]
TCP ajit-09a2e2cg34:microsoft-ds 0.0.0.0:0 LISTENING
[System]
TCP ajit-09a2e2cg34:1521 0.0.0.0:0 LISTENING 2704
[TNSLSNR.exe]
TCP ajit-09a2e2cg34
ptp 0.0.0.0:0 LISTENING 4
[System]
TCP ajit-09a2e2cg34:2030 0.0.0.0:0 LISTENING 2088
[omtsreco.exe]
TCP ajit-09a2e2cg34:2481 0.0.0.0:0 LISTENING 2704
[TNSLSNR.exe]
TCP ajit-09a2e2cg34:3306 0.0.0.0:0 LISTENING 1832
[mysqld-nt.exe]
TCP ajit-09a2e2cg34:42510 0.0.0.0:0 LISTENING 1976
[InoRpc.exe]
TCP ajit-09a2e2cg34:1031 0.0.0.0:0 LISTENING 3972
[alg.exe]
TCP ajit-09a2e2cg34:1026 localhost:3306 ESTABLISHED 848
[winmysqladmin.exe]
TCP ajit-09a2e2cg34:3306 localhost:1026 ESTABLISHED 1832
[mysqld-nt.exe]
UDP ajit-09a2e2cg34:microsoft-ds *:*
[System]
UDP ajit-09a2e2cg34:l2tp *:* 4
[System]
UDP ajit-09a2e2cg34:4500 *:* 748
[lsass.exe]
UDP ajit-09a2e2cg34:isakmp *:* 748
[lsass.exe]
UDP ajit-09a2e2cg34:1900 *:* 1288
c:\windows\system32\WS2_32.dll
c:\windows\system32\ssdpsrv.dll
C:\WINDOWS\system32\ADVAPI32.dll
C:\WINDOWS\system32\kernel32.dll
[svchost.exe]
UDP ajit-09a2e2cg34:1035 *:* 1048
c:\windows\system32\WS2_32.dll
C:\WINDOWS\System32\iasrad.dll
C:\WINDOWS\system32\iassdo.dll
C:\WINDOWS\System32\iashlpr.dll
C:\WINDOWS\System32\mprddm.dll
c:\windows\system32\mprdim.dll
C:\WINDOWS\System32\svchost.exe
C:\WINDOWS\system32\ADVAPI32.dll
C:\WINDOWS\system32\kernel32.dll
[svchost.exe]
UDP ajit-09a2e2cg34:ntp *:* 1048
c:\windows\system32\WS2_32.dll
c:\windows\system32\w32time.dll
ntdll.dll
-- unknown component(s) --
[svchost.exe]
UDP ajit-09a2e2cg34:1034 *:* 1048
c:\windows\system32\WS2_32.dll
C:\WINDOWS\System32\iasrad.dll
C:\WINDOWS\system32\iassdo.dll
C:\WINDOWS\System32\iashlpr.dll
C:\WINDOWS\System32\mprddm.dll
c:\windows\system32\mprdim.dll
C:\WINDOWS\System32\svchost.exe
C:\WINDOWS\system32\ADVAPI32.dll
C:\WINDOWS\system32\kernel32.dll
[svchost.exe]
*******************************************************************
What am I missing? Any suggestions from you would be greatly appreciated.
Thank You
[ July 14, 2008: Message edited by: ajit kumar Verma ]