'Active directory non-interactive user with sql server on premise, problem conection
I am trying to configure a domain user that does not have Interactive Login active en Active Directory. So far I have not succeeded.
The connection is against an on-premises Sql Server DB (not Azure DB)
The test is with java code, any suggestions
private static void ConectSqlServerUrl_test() throws ClassNotFoundException {
System.out.println("====== ConectSqlServerUrl_TEST================");
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
String connectionUrl = "jdbc:sqlserver://server.com;"
+ "databaseName=DBtest;"
+ "integratedSecurity=false;"
+ "user=DOM\\user;"
+ "password=password"
+ "trustServerCertificate=true;"
+ "authenticationScheme=NTLM;"
//+ "sslProtocol=TLSv1.2;"
;
// + "loginTimeout=30;";
ResultSet resultSet = null;
try (Connection connection = DriverManager.getConnection(connectionUrl);
Statement statement = connection.createStatement();) {
// Create and execute a SELECT SQL statement.
String selectSql = "SELECT ORIGINAL_LOGIN( ), GETDATE();";
resultSet = statement.executeQuery(selectSql);
// Print results from select statement
System.out.println("Conexion exitosa");
while (resultSet.next()) {
System.out.println(resultSet.getString(1));
}
} catch (SQLException e) {
Date d = new Date();
System.out.println("Ejecucion: " + d.toString());
System.out.println();
e.printStackTrace();
}
}
Error Login failed for user 'DOM\USER'. Reason: Attempting to use an NT account name with SQL Server Authentication. [CLIENT: XX.XX.XX.XX]
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

