Skip to content

Commit 806a874

Browse files
yahondaclaude
andcommitted
Upgrade JDBC driver to ojdbc17.jar and add modern driver support
- Upgrade all workflows from ojdbc11.jar 23.3 to ojdbc17.jar 23.26.1 - Add ojdbc17, ojdbc11, and ojdbc8 to JDBC driver search list in jdbc_connection.rb, matched to Java version requirements - Update README with current JDBC driver names and download link Ref: https://www.oracle.com/database/technologies/appdev/jdbc-downloads.html Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5ea974a commit 806a874

6 files changed

Lines changed: 23 additions & 21 deletions

File tree

.github/workflows/jruby_head.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
echo "/opt/oracle/instantclient_23_26" >> $GITHUB_PATH
5858
- name: Install JDBC Driver
5959
run: |
60-
wget -q https://download.oracle.com/otn-pub/otn_software/jdbc/233/ojdbc11.jar -O ./lib/ojdbc11.jar
60+
wget -q https://download.oracle.com/otn-pub/otn_software/jdbc/23261/ojdbc17.jar -O ./lib/ojdbc17.jar
6161
- name: Create database user
6262
run: |
6363
./ci/setup_accounts.sh

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
echo "/opt/oracle/instantclient_23_26" >> $GITHUB_PATH
6363
- name: Install JDBC Driver
6464
run: |
65-
wget -q https://download.oracle.com/otn-pub/otn_software/jdbc/233/ojdbc11.jar -O ./lib/ojdbc11.jar
65+
wget -q https://download.oracle.com/otn-pub/otn_software/jdbc/23261/ojdbc17.jar -O ./lib/ojdbc17.jar
6666
- name: Create database user
6767
run: |
6868
./ci/setup_accounts.sh

.github/workflows/test_11g.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,19 @@ jobs:
6767
echo "/opt/oracle/instantclient_21_15" >> $GITHUB_PATH
6868
- name: Install JDBC Driver
6969
run: |
70-
wget -q https://download.oracle.com/otn-pub/otn_software/jdbc/233/ojdbc11.jar -O ./lib/ojdbc11.jar
70+
wget -q https://download.oracle.com/otn-pub/otn_software/jdbc/23261/ojdbc17.jar -O ./lib/ojdbc17.jar
7171
- name: Configure ORA_TZFILE to match Oracle 11g server
7272
run: |
73-
# Oracle 11g XE uses timezone file v14; Instant Client 21.15 embeds v35.
74-
# This mismatch causes ORA-01805 when ruby-oci8 fetches DATE/TIMESTAMP
73+
# Oracle 11g XE uses timezone file v14; Instant Client 21.15 embeds
74+
# v35. This mismatch causes ORA-01805 when fetching DATE/TIMESTAMP
7575
# values. Copy the v14 files from the 11g container and point the
7676
# Instant Client at them via ORA_TZFILE.
77-
ORACLE_CONTAINER=$(docker ps --filter "ancestor=gvenzl/oracle-xe:11" -q)
78-
sudo mkdir -p /opt/oracle/instantclient_21_15/oracore/zoneinfo
77+
ORACLE_CONTAINER="${{ job.services.oracle.id }}"
78+
sudo mkdir -p "$ORACLE_HOME/oracore/zoneinfo"
7979
docker cp "$ORACLE_CONTAINER":/u01/app/oracle/product/11.2.0/xe/oracore/zoneinfo/timezlrg_14.dat /tmp/timezlrg_14.dat
8080
docker cp "$ORACLE_CONTAINER":/u01/app/oracle/product/11.2.0/xe/oracore/zoneinfo/timezone_14.dat /tmp/timezone_14.dat
81-
sudo mv /tmp/timezlrg_14.dat /opt/oracle/instantclient_21_15/oracore/zoneinfo/
82-
sudo mv /tmp/timezone_14.dat /opt/oracle/instantclient_21_15/oracore/zoneinfo/
81+
sudo mv /tmp/timezlrg_14.dat "$ORACLE_HOME/oracore/zoneinfo/"
82+
sudo mv /tmp/timezone_14.dat "$ORACLE_HOME/oracore/zoneinfo/"
8383
echo "ORA_TZFILE=timezlrg_14.dat" >> $GITHUB_ENV
8484
- name: Create database user
8585
run: |

.github/workflows/test_gemfiles.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
echo "/opt/oracle/instantclient_23_26" >> $GITHUB_PATH
8585
- name: Install JDBC Driver
8686
run: |
87-
wget -q https://download.oracle.com/otn-pub/otn_software/jdbc/233/ojdbc11.jar -O ./lib/ojdbc11.jar
87+
wget -q https://download.oracle.com/otn-pub/otn_software/jdbc/23261/ojdbc17.jar -O ./lib/ojdbc17.jar
8888
- name: Create database user
8989
run: |
9090
./ci/setup_accounts.sh

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ In addition install either ruby-oci8 (for MRI/YARV) or copy Oracle JDBC driver t
154154
If you are using MRI Ruby implementation then you need to install ruby-oci8 gem (version 2.1 or higher)
155155
as well as Oracle client, e.g. [Oracle Instant Client](http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html).
156156

157-
If you are using JRuby then you need to download latest [Oracle JDBC driver](http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-112010-090769.html) - either ojdbc7.jar for Java 8 and 7, ojdbc6.jar for Java 6, 7, 8 or ojdbc5.jar for Java 5. You can refer [the support matrix](http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-faq-090281.html#01_03) for details.
157+
If you are using JRuby then you need to download latest [Oracle JDBC driver](https://www.oracle.com/database/technologies/appdev/jdbc-downloads.html) - ojdbc17.jar for Java 17+, ojdbc11.jar for Java 11+, or ojdbc8.jar for Java 8+.
158158

159159
And copy this file to one of these locations. JDBC driver will be searched in this order:
160160

lib/plsql/jdbc_connection.rb

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,23 @@
22
require "java"
33
require "jruby"
44

5-
# ojdbc6.jar or ojdbc5.jar file should be in JRUBY_HOME/lib or should be in ENV['PATH'] or load path
5+
# Oracle JDBC driver jar should be in JRUBY_HOME/lib or should be in ENV['PATH'] or load path
66

77
java_version = java.lang.System.getProperty("java.version")
8-
ojdbc_jars = if java_version =~ /^1.5/
9-
%w(ojdbc5.jar)
10-
elsif java_version =~ /^1.6/
11-
%w(ojdbc6.jar)
12-
elsif java_version >= "1.7"
13-
# Oracle 11g client ojdbc6.jar is also compatible with Java 1.7
14-
# Oracle 12c client provides new ojdbc7.jar
15-
%w(ojdbc7.jar ojdbc6.jar)
8+
java_major = if java_version =~ /^1\.(\d+)/
9+
$1.to_i
1610
else
17-
[]
11+
java_version.to_i
1812
end
1913

14+
ojdbc_jars = []
15+
ojdbc_jars << "ojdbc17.jar" if java_major >= 17
16+
ojdbc_jars << "ojdbc11.jar" if java_major >= 11
17+
ojdbc_jars << "ojdbc8.jar" if java_major >= 8
18+
ojdbc_jars << "ojdbc7.jar" if java_major >= 7
19+
ojdbc_jars << "ojdbc6.jar" if java_major >= 6
20+
ojdbc_jars << "ojdbc5.jar" if java_major == 5
21+
2022
if ENV_JAVA["java.class.path"] !~ Regexp.new(ojdbc_jars.join("|"))
2123
# On Unix environment variable should be PATH, on Windows it is sometimes Path
2224
env_path = (ENV["PATH"] || ENV["Path"] || "").split(File::PATH_SEPARATOR)

0 commit comments

Comments
 (0)