Skip to content

Commit b85c100

Browse files
yahondaclaude
andcommitted
Use MYSERVICENAME in examples and tests
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9ffed49 commit b85c100

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ and then you do not need to specify plsql.connection (this is also safer when Ac
125125
When using JRuby, the `connect!` method with `:host` and `:database` options uses the thin-style service name syntax by default:
126126

127127
```ruby
128-
# Connects using service name syntax: jdbc:oracle:thin:@//localhost:1521/MYSERVICE
129-
plsql.connect! username: "hr", password: "hr", host: "localhost", database: "MYSERVICE"
128+
# Connects using service name syntax: jdbc:oracle:thin:@//localhost:1521/MYSERVICENAME
129+
plsql.connect! username: "hr", password: "hr", host: "localhost", database: "MYSERVICENAME"
130130
```
131131

132132
If you need to connect using the legacy SID syntax (for Oracle databases older than 12c), prefix the database name with a colon:

spec/plsql/connection_spec.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -469,13 +469,13 @@
469469

470470
describe "JDBC connection URL" do
471471
it "should use service name syntax by default" do
472-
url = PLSQL::JDBCConnection.jdbc_connection_url(host: "myhost", port: 1521, database: "MYDB")
473-
expect(url).to eq "jdbc:oracle:thin:@//myhost:1521/MYDB"
472+
url = PLSQL::JDBCConnection.jdbc_connection_url(host: "myhost", port: 1521, database: "MYSERVICENAME")
473+
expect(url).to eq "jdbc:oracle:thin:@//myhost:1521/MYSERVICENAME"
474474
end
475475

476476
it "should use default host and port when not specified" do
477-
url = PLSQL::JDBCConnection.jdbc_connection_url(database: "/MYDB")
478-
expect(url).to eq "jdbc:oracle:thin:@//localhost:1521/MYDB"
477+
url = PLSQL::JDBCConnection.jdbc_connection_url(database: "/MYSERVICENAME")
478+
expect(url).to eq "jdbc:oracle:thin:@//localhost:1521/MYSERVICENAME"
479479
end
480480

481481
it "should use SID syntax when database starts with colon" do
@@ -484,8 +484,8 @@
484484
end
485485

486486
it "should use service name syntax when database starts with slash" do
487-
url = PLSQL::JDBCConnection.jdbc_connection_url(host: "myhost", port: 1521, database: "/MYSERVICE")
488-
expect(url).to eq "jdbc:oracle:thin:@//myhost:1521/MYSERVICE"
487+
url = PLSQL::JDBCConnection.jdbc_connection_url(host: "myhost", port: 1521, database: "/MYSERVICENAME")
488+
expect(url).to eq "jdbc:oracle:thin:@//myhost:1521/MYSERVICENAME"
489489
end
490490

491491
it "should use TNS alias when TNS_ADMIN is set and no host specified" do
@@ -496,8 +496,8 @@
496496
end
497497

498498
it "should use custom URL when provided" do
499-
custom_url = "jdbc:oracle:thin:@//custom:1522/MYDB"
500-
url = PLSQL::JDBCConnection.jdbc_connection_url(host: "myhost", database: "MYDB", url: custom_url)
499+
custom_url = "jdbc:oracle:thin:@//custom:1522/MYSERVICENAME"
500+
url = PLSQL::JDBCConnection.jdbc_connection_url(host: "myhost", database: "MYSERVICENAME", url: custom_url)
501501
expect(url).to eq custom_url
502502
end
503503
end if defined?(JRuby)

0 commit comments

Comments
 (0)