rsim/oracle-enhanced — Issue #147: JNDI connections don't work with wrapped connections
Author: moger777
Created: 2012-02-10 02:52:44+00:00
State: open

To use JNDI connections with oracle enhanced, on unwrapped jdbc connection is needed do to calls to getNUMBER, getRAW. When using Websphere, it seems that it's not possible to configure to use unwrapped jdbc connection (if I am wrong here, feel free to chime in). I was thinking of modifying the code so that:

line 492 of oracle_enhanced_jdbc_connection.rb

```ruby
when :NUMBER
d = rset.getNUMBER(i)
if d.nil?
nil
elsif d.isInt
Integer(d.stringValue)
else
BigDecimal.new(d.stringValue)
end
```

becomes:

```ruby
when :NUMBER
d = rset.getString(i)
if rset.wasNull
d
elsif rset.getMetaData.getScale(i) == 0
Integer(d)
else
BigDecimal.new(d)
end
```

I was wondering if there are any unforeseen consequences I should be aware of before I get too far coding this (I'll probably do something similar to getRAW).