Commit 2e65ff5
committed
Namespace ORACLE_DRIVER and polish JDBC loader error handling
Move ORACLE_DRIVER and the DriverManager.registerDriver call inside
class PLSQL::JDBCConnection so the driver instance is no longer a
top-level Ruby constant that pollutes the host application's
namespace. Update the spec test harness to reference it via its
fully qualified name PLSQL::JDBCConnection::ORACLE_DRIVER.
Polish the loader's error reporting:
- Hoist `ojdbc_jars = []` above the begin block so the
`rescue LoadError` interpolation never references an unbound
local even when `require "java"` itself fails.
- When the Oracle JDBC jar isn't on the classpath
(NameError on Java::oracle.jdbc.OracleDriver), raise a LoadError
that hints at installing an Oracle JDBC driver such as
ojdbc17.jar and points at
https://www.oracle.com/database/technologies/appdev/jdbc-downloads.html1 parent 819434d commit 2e65ff5
2 files changed
Lines changed: 13 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
| |||
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
14 | | - | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | 39 | | |
42 | 40 | | |
43 | 41 | | |
44 | 42 | | |
45 | 43 | | |
46 | | - | |
| 44 | + | |
47 | 45 | | |
48 | 46 | | |
49 | 47 | | |
50 | 48 | | |
51 | 49 | | |
52 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
53 | 60 | | |
54 | 61 | | |
55 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| |||
0 commit comments