connect to sql express DB

Posted on 2007-07-31
Last Modified: 2010-03-19
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();
Question by:zolf
    1 Comment
    LVL 42

    Accepted Solution

    Because "\" is an escape character, try this:


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
    This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now