0

I'm new to Java. I'd like to build a CRUD application with SQL Server as the database. It will be implemented on an Active Directory domain and I'd like to use integrated security. How can I package the application so that the driver including the authentication library "mssql-jdbc_auth-9.2.0.x64.dll" be included and used in the installed application.

I created a test application where I included a Java Build Path\Classpath entry of: "C:\Program Files\Microsoft JDBC DRIVER 9.2 for SQL Server\sqljdbc_9.2\enu\mssql-jdbc-9.2.0.jre15.jar" for the driver.

It runs in Eclipse with integrated security if I put a copy of the authentication library "mssql-jdbc_auth-9.2.0.x64.dll" from the driver in either of the following directories:

  • C:\Program Files\Java\jdk-15.0.2\bin
  • C:\Windows\System32
  • C:\Program Files\SQL1-Test\runtime\bin of installed application

Or use:

  • VM run configuration arguments: -Djava.library.path="C:\Program Files\Microsoft JDBC DRIVER 9.2 for SQL Server\sqljdbc_9.2\enu\auth\x64" in the project.

When I try to export to a jar file for packaging with the above VM arguments applied it says "VM arguments will not be part of the runnable JAR".

The installed application will run with integrated security if the the authentication library "mssql-jdbc_auth-9.2.0.x64.dll" is in any of the above directories.

How can the I ensure that the authentication library "mssql-jdbc_auth-9.2.0.x64.dll" will be functionally included in the installed application.

Has anyone created such an application or have pointers on how to do this.

Thanks.

4

0 回答 0