Uso:
- Eclipse Oxygen
- SQL Server 2017
- SQL Management Studio 17.3
- Microsoft JDBC Driver 6.0 for SQL Server
- Java
jre1.8.0_151
x64 - Windows 10 x64
Cada vez que ejecuto mi programa recibo el siguiente error.
Error:
SQLServerException: This driver is not configured for integrated authentication.
He intentado:
- https://stackoverflow.com/questions/10637585/native-library-sqljdbc-auth-dll-already-loaded-in-another-classloader?answertab=votes#tab-top
- https://stackoverflow.com/questions/957700/how-to-set-the-java-library-path-from-eclipse/958074#958074
- https://stackoverflow.com/questions/17277001/dll-missing-in-jdbc
- https://stackoverflow.com/questions/32536608/this-driver-is-not-configured-for-integrated-authentication
- https://stackoverflow.com/questions/6087819/jdbc-sqlserverexception-this-driver-is-not-configured-for-integrated-authentic
- https://developer.ibm.com/answers/questions/364184/jdbc-throwing-sqlserverexception-this-driver-is-no.html
- https://blogs.msdn.microsoft.com/jdbcteam/2007/06/18/com-microsoft-sqlserver-jdbc-sqlserverexception-this-driver-is-not-configured-for-integrated-authentication/
- Tengo
sqljdbc_auth
en "C:\Program Files\Java\jre1.8.0_151\bin". - Tengo
sqljdbc_auth
en "C:\Program Files\Java\jre1.8.0_151\lib". - Tengo
sqljdbc42
en mi proyecto y en Java Build Path. - He intentado agregando
sqljdbc_auth
(x64 y x86) a "C:\Windows\System32". - He intentado agregando
sqljdbc_auth
(x64 y x86) a "C:\Windows\SysWOW64".
Mi clase de conexión:
public class ConexionSQL {
public String driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
public String database = "industriaCine";
public String hostname = "localhost";
public String port = "1433";
public String url = "jdbc:sqlserver://" + hostname + ":" + port + ";databaseName=" + database + ";integratedSecurity=true";
public Connection conectarSQL() {
Connection conn = null;
try {
Class.forName(driver);
conn = DriverManager.getConnection(url);
System.out.println("Conectado a la base de datos.");
} catch (ClassNotFoundException | SQLException e) {
JOptionPane.showMessageDialog(null, "SQLException:\n" + e, "Error: conectarSQL()", JOptionPane.ERROR_MESSAGE);
}
return conn;
}
}
Nada me funciona, sigo recibiendo el mismo error. Cómo puedo solucionarlo?.
Gracias de antemano.