# ActiveRecord-JDBC Oracle

**URL:** <https://www.ruby-forum.com/t/activerecord-jdbc-oracle/196662>\
**Category:** Rails\
**Created:** [May 2, 2008, 1:28pm UTC](https://www.ruby-forum.com/t/activerecord-jdbc-oracle/196662 "2008-05-02T13:28:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lgas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/a87d85/32.png) [@lgas](https://www.ruby-forum.com/u/lgas)\
**Post date:** [May 2, 2008, 1:28pm UTC](https://www.ruby-forum.com/t/activerecord-jdbc-oracle/196662/1 "2008-05-02T13:28:18Z")

</div>

Hi,

Iâ€™m trying to migrate the AR script on to Oracle database. Im using jdbc  
adapter.

There are number of functions defined in jdbc\_oracle.rb, but when I call  
them (eg: rename\_column(â€¦)) in my AR script, it says â€œrake aborted !!  
rename\_column is not implementedâ€ .  
It is not referring to the jdbc\_oracle.rb file. Is there any  
configuration setting to be done?

I have written many custom functions in jdbc\_postgre.rb and  
jdbc\_mssql.rb, it works absolutely fine.

Please find the sample code attached.

1. 001\_rename\_columns.rb (file to migrate)

class CreateOrclTables \< ActiveRecord::Migration  
def self.up  
rename\_column(:companyprofile, :tname, :tname\_new)  
end  
def self.down  
end  
end

1. database.yml

development\_orcl1:  
adapter: jdbc  
username: scott  
password: tiger  
driver: com.inet.ora.OraDriver  
url: jdbc:inetora:vxind01:1521:BAPCDEV1

1. jdbc\_oracle.rb (adapter: jdbc)

The file is under (  
D:\jruby-1.0.0RC1\lib\ruby\gems\1.8\gems\ActiveRecord-JDBC-0.3.1\lib\jdbc\_adapter  
)

Please refer the jdbc\_oracle.rb file attached.

Appreciate your response !!

Thanks,  
John

---

<div class="post-metadata">

**Author:** ![lgas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/a87d85/32.png) [@lgas](https://www.ruby-forum.com/u/lgas)\
**Post date:** [May 2, 2008, 7:09pm UTC](https://www.ruby-forum.com/t/activerecord-jdbc-oracle/196662/2 "2008-05-02T19:09:29Z")

</div>

On Fri, May 2, 2008 at 6:28 AM, John E.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> configuration setting to be done?  
> rename\_column(:companyprofile, :tname, :tname\_new)  
> password: tiger  
> driver: com.inet.ora.OraDriver  
> url: jdbc:inetora:vxind01:1521:BAPCDEV1
> 
> 1. jdbc\_oracle.rb (adapter: jdbc)
> 
> The file is under (  
> D:\jruby-1.0.0RC1\lib\ruby\gems\1.8\gems\ActiveRecord-JDBC-0.3.1\lib\jdbc\_adapter  
> )
> 
> Please refer the jdbc\_oracle.rb file attached.

Do you have the requisite configuration in environment.rb to ensure  
that the jdbc adapter is loaded?

See [http://wiki.jruby.org/wiki/Running\_Rails\_with\_ActiveRecord-JDBC](http://wiki.jruby.org/wiki/Running_Rails_with_ActiveRecord-JDBC) for  
details.

Also, 0.3.1 is pretty old (as is JRuby 1.0.0RC1). If you want to help  
develop the jdbc oracle support further it would be great if you could  
update to JRuby 1.1.1 and ar-jdbc 0.8.

Finally, can we take this discussion over to the jruby-user list?

[http://xircles.codehaus.org/projects/jruby/lists](http://xircles.codehaus.org/projects/jruby/lists)

Cheers,  
/Nick

---

<div class="post-metadata">

**Author:** ![lgas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/a87d85/32.png) [@lgas](https://www.ruby-forum.com/u/lgas)\
**Post date:** [May 5, 2008, 7:58am UTC](https://www.ruby-forum.com/t/activerecord-jdbc-oracle/196662/3 "2008-05-05T07:58:11Z")

</div>

Hi Nick,

Thanks for your response.

I have the requisite configuration done in environment.rb. Below are the  
detials.

require ‘rubygems’  
gem ‘ActiveRecord-JDBC’  
require ‘jdbc\_adapter’

Interesting part is, a simple create\_table script works fine even when I  
deleted the contents of jdbc\_oracle.rb file and made it blank.  
But when I deleted the file jdbc\_oracle.rb from the folder, it throws an  
error “could not find file jdbc\_oracle.rb”.

I had a look at [http://xircles.codehaus.org/projects/jruby/lists](http://xircles.codehaus.org/projects/jruby/lists)

There are number of email-ids, to which ID should I post the message or  
which is the relevant forum?

Awaiting your response.

Thanks,  
John

Nick S. wrote:

> On Fri, May 2, 2008 at 6:28 AM, John E.  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > configuration setting to be done?  
> > rename\_column(:companyprofile, :tname, :tname\_new)  
> > password: tiger  
> > driver: com.inet.ora.OraDriver  
> > url: jdbc:inetora:vxind01:1521:BAPCDEV1
> > 
> > 1. jdbc\_oracle.rb (adapter: jdbc)
> > 
> > The file is under (  
> > D:\jruby-1.0.0RC1\lib\ruby\gems\1.8\gems\ActiveRecord-JDBC-0.3.1\lib\jdbc\_adapter  
> > )
> > 
> > Please refer the jdbc\_oracle.rb file attached.
> 
> Do you have the requisite configuration in environment.rb to ensure  
> that the jdbc adapter is loaded?
> 
> See [http://wiki.jruby.org/wiki/Running\_Rails\_with\_ActiveRecord-JDBC](http://wiki.jruby.org/wiki/Running_Rails_with_ActiveRecord-JDBC) for  
> details.
> 
> Also, 0.3.1 is pretty old (as is JRuby 1.0.0RC1). If you want to help  
> develop the jdbc oracle support further it would be great if you could  
> update to JRuby 1.1.1 and ar-jdbc 0.8.
> 
> Finally, can we take this discussion over to the jruby-user list?
> 
> [http://xircles.codehaus.org/projects/jruby/lists](http://xircles.codehaus.org/projects/jruby/lists)
> 
> Cheers,  
> /Nick

---

<div class="post-metadata">

**Author:** ![lgas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/a87d85/32.png) [@lgas](https://www.ruby-forum.com/u/lgas)\
**Post date:** [May 9, 2008, 7:53am UTC](https://www.ruby-forum.com/t/activerecord-jdbc-oracle/196662/4 "2008-05-09T07:53:34Z")

</div>

Thanks very much Nick !!

I will post it there …

regards  
John.

Nick S. wrote:

> On Sun, May 4, 2008 at 10:58 PM, John E.  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > I had a look at [http://xircles.codehaus.org/projects/jruby/lists](http://xircles.codehaus.org/projects/jruby/lists)
> > 
> > There are number of email-ids, to which ID should I post the message or  
> > which is the relevant forum?
> 
> The jruby-user list should be fine for this.
> 
> /Nick

---

<div class="post-metadata">

**Author:** ![lgas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/a87d85/32.png) [@lgas](https://www.ruby-forum.com/u/lgas)\
**Post date:** [May 5, 2008, 4:25pm UTC](https://www.ruby-forum.com/t/activerecord-jdbc-oracle/196662/5 "2008-05-05T16:25:11Z")

</div>

On Sun, May 4, 2008 at 10:58 PM, John E.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I had a look at [http://xircles.codehaus.org/projects/jruby/lists](http://xircles.codehaus.org/projects/jruby/lists)
> 
> There are number of email-ids, to which ID should I post the message or  
> which is the relevant forum?

The jruby-user list should be fine for this.

/Nick
