Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Error establishing socket

0 views
Skip to first unread message

Tom Berry

unread,
Nov 12, 2001, 2:05:55 PM11/12/01
to
I've tried just a very basic connection to SQL Server with
the code below. The driver is found but I always get
an "Error establishing socket" when I try to get a
connection. I currently use the JDBC-ODBC bridge with no
problems.

What can I check to eliminate this error?
Thank you
Tom Berry


private boolean initSQLConnection() {
try {
Class.forName
("com.microsoft.jdbc.sqlserver.SQLServerDriver");
System.out.println("driver found.");
conn = DriverManager.getConnection
("jdbc:microsoft:sqlserver://localhost:1433");//;User=tberr
y;Password=;DatabaseName=tasktracker");
System.out.println("connection made.");
} catch (ClassNotFoundException cnfe) {
System.err.println("First: " + cnfe.toString());
return false;
} catch (SQLException sqle) {
System.err.println("Second: " + sqle.toString());
sqle.printStackTrace();
return false;
}
return true;
}

************** Results:

driver found.
Second: java.sql.SQLException: [Microsoft][SQLServer JDBC
Driver]Error establishing socket.
java.sql.SQLException: [Microsoft][SQLServer JDBC Driver]
Error establishing socket.
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 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
(DriverManager.java:517)
at java.sql.DriverManager.getConnection
(DriverManager.java:199)
at tasktracker.SqlLink.initSQLConnection
(SqlLink.java:65)
at tasktracker.SqlLink.<init>(SqlLink.java:49)
at tasktracker.SqlLink.main(SqlLink.java:222)


Joseph Weinstein

unread,
Nov 12, 2001, 2:24:52 PM11/12/01
to Tom Berry

Tom Berry wrote:
>
> I've tried just a very basic connection to SQL Server with
> the code below. The driver is found but I always get
> an "Error establishing socket" when I try to get a
> connection. I currently use the JDBC-ODBC bridge with no
> problems.
>
> What can I check to eliminate this error?
> Thank you
> Tom Berry

Configure the DBMS to accept tcp connections. The type-4 driver
requires that, in order to make connections independently from anywhere.
The odbc driver makes the default MS-specific connection style.
Joe

Joseph Weinstein

unread,
Nov 12, 2001, 2:37:18 PM11/12/01
to Tom Berry

Tom Berry wrote:
>
> I've tried just a very basic connection to SQL Server with
> the code below. The driver is found but I always get
> an "Error establishing socket" when I try to get a
> connection. I currently use the JDBC-ODBC bridge with no
> problems.
>
> What can I check to eliminate this error?
> Thank you
> Tom Berry

Configure the DBMS to accept tcp connections. The type-4 driver


requires that, in order to make connections independently from anywhere.
The odbc driver makes the default MS-specific connection style.
Joe

>

Joseph Weinstein

unread,
Nov 12, 2001, 2:41:24 PM11/12/01
to Tom Berry

Tom Berry wrote:
>
> I've tried just a very basic connection to SQL Server with
> the code below. The driver is found but I always get
> an "Error establishing socket" when I try to get a
> connection. I currently use the JDBC-ODBC bridge with no
> problems.
>
> What can I check to eliminate this error?
> Thank you
> Tom Berry

Configure the DBMS to accept tcp connections. The type-4 driver


requires that, in order to make connections independently from anywhere.
The odbc driver makes the default MS-specific connection style.
Joe

>

Tom Berry

unread,
Nov 13, 2001, 9:19:53 AM11/13/01
to
Joe,

I checked and our SQL Servers are set to Named Pipes only.
When I get the ok, I'll add in TCP/IP.

Thank you,
Tom

>.
>

0 new messages