I’m trying to run a java app that uses Hibernate and MS SQL Server Express.
SQL Server is configured with windows authentication as the login methond. I’ve also enabled TCP/IP port 1433(default), but I still keep getting the following error.
...// more output
at test.models.TestHibernate.main(TestHibernate.java:11)
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'not required'. ClientConnectionId:de7daf69-2619-4906-b063-459a5b614bdb
...// more output
The line throwing the exception:
session.beginTransaction();
hibernate.cfg.xml:
<property name="connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
<property name="connection.url">jdbc:sqlserver://localhost;databaseName=hibernatexml;integratedSecurity=false;</property>
<property name="connection.username">not required</property>
<property name="connection.password"/>
I removed other configuration errors but with this I’m out of ideas. If you need more info just let me know
Thanks in advance.
If you want to use integrated authentication with SQL Server from your java application, then
integratedSecurityproperty set totrue.the location of
sqljdbc_auth.dllin theMicrosoft SQL Server JDBC Driverinstallation should be set to thejava.library.pathJVM argument.e.g.