-
Notifications
You must be signed in to change notification settings - Fork 57
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
DriverWrapper#mangleURL should return null (not throw an exception) ... #113
Comments
part of the comment from Driver.connect()
|
Thanks for identifying this issue! A PR to fix would be great. Would it also be possible to include a test that demonstrates the problem? |
Mhhh, one could probable "fake" the drivers, register them, and make sure that the logic ends up as intended. @phillipross yes, will do! .... welp, but we probably would also need some database to connect to? :( |
Nevermind, was easier than expected. #114 |
PR #115 has been merged which I believe addresses this issue, so I'm going to close it out. |
... if the JDBC driver is not applicable to the connection string.
Offending code: https://github.com/postgis/postgis-java/blob/main/postgis-jdbc/src/main/java/net/postgis/jdbc/DriverWrapper.java#L265
Background:
If one has multiple JDBC driver registered,
DriverManager.getConnection
is called on each one of them until one driver declares it can handle the URL.If that method throws an exception, then the "reason" is overwritten if multiple drivers are registered (e. g. Oracle, PostGis).
This causes an access attempt to an OracleDB with wrong password to return an Postgres error message.
This is because Oracle is tried and throws (correct, wrong password) and then Postgis can't handle it and also throws (not correct, should return
null
), thereby overwriting the exception and hiding the underlying problem:If you agree with the assessment, would you accept a PR?
The text was updated successfully, but these errors were encountered: