1

I am trying to connect to SQL Server using my credentials.

The data I am provided is to connect is the following:

  • Server: Ccddb294\oss_prod
  • Database: OSS_DW

Code:

public static void main(String arg[]) throws ClassNotFoundException, SQLException {
        Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");

        String dbURL = "jdbc:sqlserver://ccddb294.corp.corpcom.com:1433;databaseName=OSS_DW;integratedSecurity=true";

        Connection conn = DriverManager.getConnection(dbURL,"corp\\e21290","Anjali@1234");
        if (conn != null) {
            System.out.println("Connected");
        }
    }

I am not sure where to give oss_prod in server name. When I try to connect, I get this error:

Exception in thread "main" com.microsoft.sqlserver.jdbc.SQLServerException: Integrated authentication failed. ClientConnectionId:26ddec01-2e7e-46c3-8165-4f3646da5e7c

Can someone validate if the dbURL which I created is correct as per specification or do I need to add odd_prod - but if so, where? (Note: The dll file is correctly placed in bin and i am able to connect to server at least but not able to authenticate only)

1 Answer 1

2

After lots of hit and trials.

Following is correct db URL:

"jdbc:sqlserver://ccddb294.corp.corpcom.com:1433;
instanceName=oss_prod;
databaseName=OSS_DW;
integratedSecurity=true;
domain=corp;
authenticationscheme=NTLM;
user=e21290;
password=Anjali@1234";
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.