connect to sql express DB

hello there,

i am trying to connect to a sql server express 2005.the db is on my local computer.but i cannot connect to the db.i can connect to remote db.but not to this.i think i am doing something wrong in giving the server name.when i access the sql server management studio express the sever name is ZOLF\SQLEXPRESS.please help.

mport java.sql.*;
  * Microsoft SQL Server JDBC test program
public class Test {
  public Test() throws Exception {
    // Get connection
        Connection connection = DriverManager.getConnection("jdbc:sqlserver://ZOLF\SQLEXPRESS:1433;" + "databaseName=DSL;user=sa;password=123456");
    if (connection != null) {
      System.out.println("Successfully connected");
      // Meta data
      DatabaseMetaData meta = connection.getMetaData();
      System.out.println("\nDriver Information");
      System.out.println("Driver Name: "
       + meta.getDriverName());
      System.out.println("Driver Version: "
       + meta.getDriverVersion());
      System.out.println("\nDatabase Information ");
      System.out.println("Database Name: "
       + meta.getDatabaseProductName());
      System.out.println("Database Version: "+
 } // Test
 public static void main (String args[]) throws Exception {
  Test test = new Test();
Who is Participating?
Because "\" is an escape character, try this:

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.