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

Load mssql jdbc driver with safety checks #6

Merged
merged 3 commits into from
Dec 11, 2020

Conversation

iaddict
Copy link

@iaddict iaddict commented Dec 9, 2020

First check if a jdbc driver is already loaded and then check if driver major version is sufficient.
Otherwise require "jdbc/mssql". Also see #4.

First check if a jdbc driver is already loaded and then check if driver major version is sufficient.
Otherwise require "jdbc/mssql".
Copy link
Collaborator

@rdubya rdubya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call on going this route. I like this approach.

which = driver
.getClass().getClassLoader().loadClass(driver_name)
.getProtectionDomain().getCodeSource().getLocation().to_s
warn "You alreday required a mssql jdbc driver (#{which}), skipping gem jdbc-mssql"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type here: "already"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. Typo has been fixed.

@rdubya rdubya merged commit 63e8a46 into jruby:5-2-stable-jdbc Dec 11, 2020
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

Successfully merging this pull request may close these issues.

2 participants