In my project we are using Microsoft SQL Server Management Studio for database testing and now we need to automate some flows that involves database testing. Below is the pre-login screenshot where we used to enter the servername as required, authentication as "Windows authentication". Then the username will automatically populate and there is no need to enter the password.
So to connect to the database I am using the below code but while executing I am getting error as "Login failed for user PILOTCORP\chatterp".
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
Connection con=DriverManager.getConnection("jdbc:sqlserver://ipaddress:portnumber;Databases=knxfpdbscrum\\FuelPact","username","password");
Statement st= con.createStatement();
In the code I have entered the database name as "knxfpdbscrum\FuelPact" since we need to select Database name as FuelPact.
Please help me.