Skip to content

Use thin-style service name syntax for JDBC connections#251

Merged
yahonda merged 1 commit intorsim:masterfrom
yahonda:jdbc-service-name-syntax
Apr 13, 2026
Merged

Use thin-style service name syntax for JDBC connections#251
yahonda merged 1 commit intorsim:masterfrom
yahonda:jdbc-service-name-syntax

Conversation

@yahonda
Copy link
Copy Markdown
Collaborator

@yahonda yahonda commented Apr 13, 2026

Summary

Change the default JDBC connection URL format from SID syntax (jdbc:oracle:thin:@host:port:DB) to service name syntax (jdbc:oracle:thin:@//host:port/DB), which is required for Oracle 12c+ with pluggable databases (PDB).

Changes

  • Extract jdbc_connection_url class method from create_raw for testability
  • Default to service name syntax (@//host:port/service) for JDBC URLs
  • Preserve SID syntax when database is prefixed with : (e.g., database: ":MYSID")
  • Skip TNS-alias path when database starts with / or : so explicit service-name/SID syntax is respected even when TNS_ADMIN is set
  • Raise ArgumentError when both :database and :url are missing
  • Add specs for all JDBC URL generation paths
  • Document JRuby JDBC connection options in README

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates JRuby JDBC connection URL generation to default to Oracle thin-style service name syntax (@//host:port/service_name) to avoid ORA-12505 on Oracle 23c, while documenting an opt-in SID fallback via a :SID prefix.

Changes:

  • Switch JDBC URL construction to service-name syntax by default and add jdbc_connection_url helper for URL building.
  • Update test helpers to use the new URL format in JRuby.
  • Add JDBC URL unit specs and document the new behavior (including SID prefix usage) in the README.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
lib/plsql/jdbc_connection.rb Refactors raw connection creation and changes default JDBC URL format to service-name syntax.
lib/plsql/schema.rb Updates inline example JDBC URL to match thin-style service-name syntax.
spec/spec_helper.rb Adjusts JRuby test connection URL generation to use @//.../... format.
spec/support/test_db.rb Updates JRuby SYSTEM connection URL used for test DB setup.
spec/plsql/connection_spec.rb Adds unit tests for JDBC URL construction behavior.
README.md Documents JRuby JDBC behavior and how to request SID-style connections.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Change the default JDBC connection URL format from SID syntax
(jdbc:oracle:thin:@host:port:DB) to service name syntax
(jdbc:oracle:thin:@//host:port/DB), which is required for Oracle 12c+
with pluggable databases (PDB).

- Extract jdbc_connection_url method for testability
- Skip TNS-alias path when database starts with `/` or `:` so that
  explicit service-name/SID syntax is respected even when TNS_ADMIN is set
- Raise ArgumentError when both :database and :url are missing
- Add specs for all JDBC URL generation paths
- Document JRuby JDBC connection options in README

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@yahonda yahonda merged commit 3042b1f into rsim:master Apr 13, 2026
22 checks passed
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