I want to connect to Sql Server using Java with Windows Authentication but I get the following error: This driver is not configured for integrated authentication. ClientConnectionId: 0b65956b-a286-4aef-a372-ab741a239761
This is the code I use:
public Connection getConectar(){
Connection cn=null;
try {
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
cn = DriverManager.getConnection("jdbc:sqlserver://localhost:1433;databaseName=VENTAS2017;integratedSecurity=true");
System.out.println("Conexion Exitosa");
}
catch (Exception e) {
//e.printStackTrace();
System.out.println("ERROR"+e.getMessage());
}
return cn;
}