I am trying to connect to SQL Server 2008 server from Java
here is a program
import java.sql.*;
public class connectURL {
public static void m
Do you have localhost defined in your hosts file? Try replacing localhost with 127.0.0.1 in the connection url.
...and you have the SQL Server running in the same computer, right?
I thing the connection URL may be wrong. Then try following connection,
String Connectionurl="jdbc:sqlserver://localhost:1433;DatabaseName=YourDBName;user=UserName;Password=YourPassword"
TCP/IP connections are disabled by default when you install the Express version of SQL Server. You need to run the SQL Server Configuration Manager and turn on TCP/IP. You also need to set the port it's listening on to 1433.