Results 1 to 1 of 1
- 12-26-2011, 11:49 PM #1
Member
- Join Date
- Dec 2011
- Posts
- 2
- Rep Power
- 0
Connecting java application with SQL management studio 2008
Hello everyone,
I am trying to connect an application in eclipse with sql server 2008. I cannot make the connections as I get errors. I have enabled TCP/IP connections , firewall has been blocked but still not working
CODE:
import java.sql.*;
import com.microsoft.sqlserver.jdbc.*;
public class MetroWay {
public static void main(String[] args) {
Connection connection;
try {
Class.forName("com.microsoft.sqlserver.jdbc.SQLSer verDriver");
connection = DriverManager.getConnection("jdbc:sqlserver://SQLEXPRESS");
System.out.println("Connection succeed!");
}
catch (Exception e) {
e.printStackTrace();
}
}
}
**SQLEXPRESS is the server for connection
ERRORS:
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host SQLEXPRESS, port 1433 has failed. Error: "null. Verify the connection properties, check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.".
at com.microsoft.sqlserver.jdbc.SQLServerException.ma keFromDriverError(SQLServerException.java:171)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.c onnectHelper(SQLServerConnection.java:1033)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.l ogin(SQLServerConnection.java:817)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.c onnect(SQLServerConnection.java:700)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.conne ct(SQLServerDriver.java:842)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at MetroWay.main(MetroWay.java:11)
Similar Threads
-
Visual Studio 2008 + Eclipse IDE for Java EE Developers ?
By icewall0 in forum EclipseReplies: 10Last Post: 04-12-2010, 04:33 AM -
java application connecting to a server
By wildheart25c in forum New To JavaReplies: 2Last Post: 09-17-2009, 02:59 AM -
[SOLVED] License management for a Standalone java application?
By kzvi.kzvi.1 in forum Advanced JavaReplies: 4Last Post: 04-23-2009, 09:54 PM -
connecting a java application to a DB in netbeans
By kulangotski in forum Advanced JavaReplies: 4Last Post: 03-22-2009, 09:58 AM -
Connecting to SQL Server 2008 DB
By Lyle in forum EclipseReplies: 1Last Post: 02-22-2009, 04:26 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks