SQL MSDE -> JDBC Connection

Hey Guys,

 

I am putting a java application togehter to read from oracle into sql msde for application purposes.

My problem however does not lie with the database connections per say but does regard the SQL MSDE connection string.

I am getting a sucessful connection to the MSDE database instance, but it is connecting straight into the database as "master", i cannot for the life of me figure out how to connect straight into one of the databases within the msde (other than master). I have a database instance called takeon running within me local instance of msde -> localhost\takeondb. I want\need to connect to the takeon database.

this is the connection string i am using:

public Statement openSQLConnection()throws SQLException{
        /*
         *Opens the connection to the local(or shared) SQL Desktop Engine Database
         *returns the Statement when connection is available
         */
        DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver());
        sqlCon = DriverManager.getConnection   ("jdbc:sqlserver://localhost:1179;DATABASE=TAKON;user=sa;password=xxxxxxxxxx");
        sqlStmt = sqlCon.createStatement();
       
        return sqlStmt;
    }

I have tried the follwoing url

("jdbc:sqlserver://localhost:1179;DATABASE=TAKEON;user=sa;password=xxxxxxxxxx");

No luck: Bad URL

Any ideas most appreciated

Robert




Answer this question

SQL MSDE -> JDBC Connection

  • Gabriel Kevorkian

    Sorry Lads your too late:)

    I have figured it out.

    Need to set up another user (other than sa) for the instance, was the new user credientials in the connection string -> works like a dream.

    Robert



  • SQL MSDE -> JDBC Connection