Usage:
- 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
Every time I run my program I get the following error.
Error:
SQLServerException: This driver is not configured for integrated authentication.
I tried:
- link
- link
- link
- link
- link
- link
- link
- I have
sqljdbc_auth
in "C: \ Program Files \ Java \ jre1.8.0_151 \ bin". - I have
sqljdbc_auth
in "C: \ Program Files \ Java \ jre1.8.0_151 \ lib". - I have
sqljdbc42
in my project and in Java Build Path. - I tried adding
sqljdbc_auth
(x64 and x86) to "C: \ Windows \ System32". - I tried adding
sqljdbc_auth
(x64 and x86) to "C: \ Windows \ SysWOW64".
My connection class:
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;
}
}
Nothing works for me, I still get the same error. How can I fix it?
Thanks in advance.