Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modular Driver JAR for Java9 #569

Closed
thomasklingler opened this issue Nov 30, 2017 · 3 comments
Closed

Modular Driver JAR for Java9 #569

thomasklingler opened this issue Nov 30, 2017 · 3 comments

Comments

@thomasklingler
Copy link

Driver version or jar name

mssql-jdbc-6.3.5.jre8-preview.jar

Java/JVM version

JDK 9.0.1

Proposal

Provide a modular mssql-jdbc-mod-6.3.5-preview.jar for use with Java 9.
Add the following module-info:

import com.microsoft.sqlserver.jdbc.SQLServerDriver;
module mssql.jdbc {
	provides java.sql.Driver with SQLServerDriver;
	requires java.logging;
	requires java.naming;
	requires java.security.jgss;
	requires java.sql;
	requires java.xml;
	requires java.xml.bind;
}

The module-info could be extended to make additional public types available for direct reference:

exports com.microsoft.sqlserver.jdbc;

I tried this successfully on a copy of mssql-jdbc-6.3.5.jre8-preview.jar by adding a compiled module-info.class file, and removing the now invalid signature files from the META-INF directory.
Note that the modified jar still works for Java8: Java8 ignores the module-info class, and all other classes are compiled with Java8.

@rene-ye
Copy link
Member

rene-ye commented Dec 4, 2017

Hi @thomasklingler, the push request for an updated JDBC4.3 with module-info is currently undergoing review. In the mean time, you can test out the changes from this branch. Please feel free to provide feedback on the changes, and let us know if something doesn't work or can be improved.

@softboy99
Copy link

waiting for good news

@cheenamalhotra
Copy link
Member

cheenamalhotra commented Jul 9, 2018

Hi @softboy99 @thomasklingler

We added 'automatic-module-name' to the Manifest such that the jre10 driver Jar can now be included in modulePath and module com.microsoft.sqlserver.jdbc will be available for use in Java 10 applications. The change has been merged with PR #732 and will be available in next driver release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants