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

Prepend jdbc: to DatabaseMetaData.getURL result #23397

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

misterjpapa
Copy link
Contributor

@misterjpapa misterjpapa commented Aug 7, 2024

Fixed the PrestoDatabaseMetaData implementation of the getURL method to
include the jdbc: prefix in the resulting URL. A JDBC URL always starts with
jdbc:.

Added an unit and a product test to verify that the database connection URL
starts with the expected jdbc: prefix.

Description

Append the jdbc: prefix to the URL that is returned from the
PrestoDatabaseMetaData implementation of the getURL method.

Motivation and Context

A JDBC URL return from the getURL method of the
DatabaseMetaData interface provides a way of identifying a
database so that the appropriate driver recognizes it and
connects to it. A JDBC URL always starts with jdbc: which was
lacking in the current PrestoDatabaseMetaData implementation
of the getURL method.
#19312

Impact

Callers of the method PrestoDatabaseMetaData.getURL will be
able to use the resulting URL directly without having to prepend
the jdbc: prefix themselves.

Test Plan

Added a unit test in the TestPrestoDatabaseMetaData class and
a product test in JdbcTests class that asserts the URL starts with t
the jdbc: prefix and the rest of the URL did not change.

Contributor checklist

  • Please make sure your submission complies with our development, formatting, commit message, and attribution guidelines.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.

Release Notes

Please follow release notes guidelines and fill in the release notes below.

== RELEASE NOTES ==

JDBC
* Fix the PrestoDatabaseMetaData.getURL method to include the jdbc: prefix in the returned URL :pr:`23397`


Fixed the PrestoDatabaseMetaData implementation of the getURL method to
include the jdbc: prefix in the resulting URL. A JDBC URL always starts with jdbc:.

Added an unit and a product test to verify that the database connection URL starts with the expected jdbc: prefix.
Copy link
Contributor

@tdcmeehan tdcmeehan left a comment

Choose a reason for hiding this comment

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

Thanks @misterjpapa

@tdcmeehan tdcmeehan self-assigned this Aug 7, 2024
@tdcmeehan tdcmeehan linked an issue Aug 7, 2024 that may be closed by this pull request
@tdcmeehan tdcmeehan merged commit 6e4896d into prestodb:master Aug 7, 2024
56 checks passed
@misterjpapa misterjpapa deleted the Issue_19312 branch August 7, 2024 16:24
@tdcmeehan tdcmeehan mentioned this pull request Aug 23, 2024
34 tasks
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.

Prepend jdbc: to DatabaseMetaData.getURL result
2 participants