# Oracle-JRuby error

**URL:** <https://www.ruby-forum.com/t/oracle-jruby-error/167253>\
**Category:** Rails\
**Created:** [May 6, 2009, 12:05am UTC](https://www.ruby-forum.com/t/oracle-jruby-error/167253 "2009-05-06T00:05:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nlsmith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/43a26b/32.png) [@nlsmith](https://www.ruby-forum.com/u/nlsmith)\
**Post date:** [May 6, 2009, 12:05am UTC](https://www.ruby-forum.com/t/oracle-jruby-error/167253/1 "2009-05-06T00:05:10Z")

</div>

I am trying to migrate from RoR/MYSql to JRoR/Oracle. I am using Active  
Record JDBC to talk to the database. The Migration process to create and  
populate the database tables has been painful. My latest issue is the  
method new\_date is undefined in the JDBC adapter. I have the following  
gems installed:

\*\*\* LOCAL GEMS \*\*\*

actionmailer (2.2.2)  
actionpack (2.2.2)  
activerecord (2.2.2)  
ActiveRecord-JDBC (0.5)  
activerecord-jdbc-adapter (0.9.1)  
activeresource (2.2.2)  
activesupport (2.2.2)  
net-sftp (2.0.2)  
net-ssh (2.0.11)  
parseexcel (0.5.2)  
rails (2.2.2)  
rake (0.8.4)  
rspec (1.2.0)  
rubyzip (0.9.1)  
rufus-scheduler (1.0.13)  
sources (0.0.1)

The error dump is:

undefined method `new_date' for JdbcSpec::Oracle::Column:Module C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9.1/lib/jdbc_adapter/jdbc_oracle.rb:63:in`guess\_date\_or\_time’  
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9.1/lib/jdbc\_adapter/jdbc\_oracle.rb:59:in  
`string_to_time' C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9.1/lib/jdbc_adapter/jdbc_oracle.rb:43:in`type\_cast’  
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active\_record/dirty.rb:161:in  
`field_changed?' C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/dirty.rb:135:in`write\_attribute\_with\_dirty’  
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active\_record/attribute\_methods.rb:216:in  
`stop_date=' C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:2587:in`attributes=’  
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active\_record/base.rb:2583:in  
`each' C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:2583:in`attributes=’  
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active\_record/base.rb:2283:in  
`initialize' db/migrate//20080702000004_update_schedules.rb:5:in`up’  
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active\_record/migration.rb:280:in  
`migrate' C:/jruby-1.2.0/bin/../lib/ruby/1.8/benchmark.rb:293:in`measure’  
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active\_record/migration.rb:280:in  
`migrate' ( __DELEGATION__ ):2:in`migrate’  
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active\_record/migration.rb:480:in  
`migrate' C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/migration.rb:556:in`call’  
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active\_record/migration.rb:556:in  
`ddl_transaction' C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/migration.rb:479:in`migrate’  
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active\_record/migration.rb:466:in  
`each' C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/migration.rb:466:in`migrate’  
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active\_record/migration.rb:394:in  
`up' C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/migration.rb:377:in`migrate’  
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/tasks/databases.rake:111  
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in  
`call' C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in`execute’  
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in  
`each' C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in`execute’  
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:578:in  
`invoke_with_call_chain' C:/jruby-1.2.0/bin/../lib/ruby/1.8/monitor.rb:191:in`mon\_synchronize’  
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:571:in  
`invoke_with_call_chain' C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:564:in`invoke’  
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2027:in  
`invoke_task' C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in`top\_level’  
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in  
`each' C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in`top\_level’  
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in  
`standard_exception_handling' C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1999:in`top\_level’  
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1977:in  
`run' C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in`standard\_exception\_handling’  
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1974:in  
`run' C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/rake-0.8.4/bin/rake:31 C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/rake-0.8.4/bin/rake:19:in`load’  
C:\jruby-1.2.0\bin…\bin\rake:19

This is from a db:migrate run to insert data into a table that contains  
three date fields. The code snippet is:

```
p = Schedule.new(
                :frequency => "3",
                :status => "Active",
                :stop_date => "01-01-2020",
                :p_date => "01-01-2008",
                :start_date => "01-01-2008"
               )

p.save()

```

The migration scripts up to this point do insert data. Am I doing  
something wrong or is this a bug that I need to report somewhere? Any  
pointers are appreciated!!!

For the record, this app works with JRuby on Rails and MySQL or SQLite  
and JDBC with just the usual database.yml changes and installing the  
appropriate adapters.

Norm

---

<div class="post-metadata">

**Author:** ![nlsmith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/43a26b/32.png) [@nlsmith](https://www.ruby-forum.com/u/nlsmith)\
**Post date:** [May 6, 2009, 12:25am UTC](https://www.ruby-forum.com/t/oracle-jruby-error/167253/2 "2009-05-06T00:25:59Z")

</div>

On Tue, May 5, 2009 at 3:05 PM, Norman Smith  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I am trying to migrate from RoR/MYSql to JRoR/Oracle. I am using Active  
> Record JDBC to talk to the database. The Migration process to create and  
> populate the database tables has been painful. My latest issue is the  
> method new\_date is undefined in the JDBC adapter. I have the following  
> gems installed:

but which ones are you requiring in your app? If this is one,

> activerecord-jdbc-adapter (0.9.1)

you might want to try activerecord-jdbc-adaptor 0.8 for comparison;  
I’m trying to sort out some inconsistencies in this area right now.

Also, what driver (jar) file are you using?

–  
Hassan S. ------------------------ removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![nlsmith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/43a26b/32.png) [@nlsmith](https://www.ruby-forum.com/u/nlsmith)\
**Post date:** [May 6, 2009, 2:47pm UTC](https://www.ruby-forum.com/t/oracle-jruby-error/167253/3 "2009-05-06T14:47:46Z")

</div>

Hassan S. wrote:

> On Tue, May 5, 2009 at 3:05 PM, Norman Smith  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > I am trying to migrate from RoR/MYSql to JRoR/Oracle. I am using Active  
> > Record JDBC to talk to the database. The Migration process to create and  
> > populate the database tables has been painful. My latest issue is the  
> > method new\_date is undefined in the JDBC adapter. I have the following  
> > gems installed:
> 
> but which ones are you requiring in your app? If this is one,
> 
> > activerecord-jdbc-adapter (0.9.1)

I am using ojdbc14.jar and, yes 0.9.1 for the jdbc adapter.

> you might want to try activerecord-jdbc-adaptor 0.8 for comparison;  
> I’m trying to sort out some inconsistencies in this area right now.

I will try the 0.8 jdbc adapter!

Thanks for the suggestion! I will post my results.

Norm

---

<div class="post-metadata">

**Author:** ![nlsmith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/43a26b/32.png) [@nlsmith](https://www.ruby-forum.com/u/nlsmith)\
**Post date:** [May 6, 2009, 4:08pm UTC](https://www.ruby-forum.com/t/oracle-jruby-error/167253/4 "2009-05-06T16:08:31Z")

</div>

Norman Smith wrote:

> > you might want to try activerecord-jdbc-adaptor 0.8 for comparison;  
> > I’m trying to sort out some inconsistencies in this area right now.
> 
> I will try the 0.8 jdbc adapter!

The 0.8 adapter works! I still have a couple of issues that I will post  
separately, but I’m over this huge hurdle for the moment!

Thanks again!!!  
Norm
