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)
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 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 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
>
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
>.
>