Home > Archive > SQL Server JDBC > January 2006 > error establishing socket error









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author error establishing socket error
jkaturi@yahoo.co.uk

2005-12-21, 9:23 am

import java.sql.*;
public class SqlTest
{
public SqlTest() throws Exception
{
//Loading the driver
// DriverManager.registerDriver(new
com.microsoft.jdbc.sqlserver.SQLServerDriver());

Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
// Estalishing the connection URL , USERNAME , PASSWORD
Connection conn =
DriverManager.getConnection(" jdbc:microsoft:sqlse
rver://localhost:1433","sa","bushel90");

if (conn!= null)
{
System.out.println("SQL SEVER ");
System.out.println("Successfully connected");
}
}
public static void main (String args[]) throws Exception
{
SqlTest test = new SqlTest();
}
}

The Exact excption is like this......


Exception in thread "main" java.sql.SQLException: [Microsoft][SQLServer
2000 Driver for JDBC]Error establishing socket.
at
com.microsoft.jdbc.base.BaseExceptions. createException(Unkn
own Source)
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. SQLServerImplConnect
ion.open(Unknown
Source)
at
com.microsoft.jdbc.base.BaseConnection. getNewImplConnection
(Unknown
Source)
at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source)
at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
at java.sql.DriverManager. getConnection(Unknow
n Source)
at java.sql.DriverManager. getConnection(Unknow
n Source)
at SqlTest.<init>(SqlTest.java:17)
at SqlTest.main(SqlTest.java:30)

Kamil Sykora [MSFT]

2006-01-12, 11:23 am

Hello,

For some common causes of this exception and troubleshooting, please see:
http://support.microsoft.com/?id=313178

I would also recommend testing with Query Analyzer from the machine that
has a problem and forcing TCP/IP for the connection. That will tell you
whether this problem is specific to the JDBC driver or if you just cannot
reach the target SQL Server over TCP/IP at all.

To do so, use tcp:servername in the SQL Server dropdown when connecting
with Query Analyzer.

Thanks,
Kamil

Kamil Sykora [MSFT]
Microsoft Developer Support - Webdata

This posting is provided "AS IS", with no warranties, and confers no
rights.

Please do not send email directly to this alias. This alias is for
newsgroup
purposes only.
--------------------
| From: jkaturi@yahoo.co.uk
| Newsgroups: microsoft.public.sqlserver.jdbcdriver
| Subject: error establishing socket error
| Date: 21 Dec 2005 06:25:06 -0800
|
| import java.sql.*;
| public class SqlTest
| {
| public SqlTest() throws Exception
| {
| //Loading the driver
| // DriverManager.registerDriver(new
| com.microsoft.jdbc.sqlserver.SQLServerDriver());
|
| Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
| // Estalishing the connection URL , USERNAME , PASSWORD
| Connection conn =
|
DriverManager.getConnection(" jdbc:microsoft:sqlse
rver://localhost:1433","sa"
,"bushel90");
|
| if (conn!= null)
| {
| System.out.println("SQL SEVER ");
| System.out.println("Successfully connected");
| }
| }
| public static void main (String args[]) throws Exception
| {
| SqlTest test = new SqlTest();
| }
| }
|
| The Exact excption is like this......
|
|
| Exception in thread "main" java.sql.SQLException: [Microsoft][SQLServer
| 2000 Driver for JDBC]Error establishing socket.
| at
| com.microsoft.jdbc.base.BaseExceptions. createException(Unkn
own Source)
| 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. SQLServerImplConnect
ion.open(Unknown
| Source)
| at
| com.microsoft.jdbc.base.BaseConnection. getNewImplConnection
(Unknown
| Source)
| at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source)
| at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
| at java.sql.DriverManager. getConnection(Unknow
n Source)
| at java.sql.DriverManager. getConnection(Unknow
n Source)
| at SqlTest.<init>(SqlTest.java:17)
| at SqlTest.main(SqlTest.java:30)
|
|

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com