You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
require 'rubygems'
require 'arjdbc'
require 'active_record'
require 'active_record/version'
require "/home/anna/sqlcl/lib/ojdbc8.jar" # should be redundant...
ActiveRecord::Base.establish_connection(
:adapter => 'jdbc',
:url => 'jdbc:oracle:thin:@host:1521:dbname',
:username=>'#####',
:password=>'######'
)
#ActiveRecord::Base.connection.execute("SELECT * FROM MGMT_TARGETS where rownum=1")
class MGMT_TARGETS < ActiveRecord::Base
self.table_name = 'MGMT_TARGETS'
end
puts "records found: #{MGMT_TARGETS.all.size}"
MGMT_TARGETS.all.each do | mt |
puts "target_name: #{mt.target_name}"
end
ArgumentError: wrong number of arguments (4 for 3)
initialize at /opt/SUN/lib/ruby/gems/gems/activerecord-jdbc-adapter-52.1-java/lib/arjdbc/abstract/core.rb:12
require 'rubygems'
new at /opt/SUN/lib/ruby/gems/gems/activerecord-jdbc-adapter-52.1-java/lib/arjdbc/jdbc/callbacks.rb:12
jdbc_connection at /opt/SUN/lib/ruby/gems/gems/activerecord-jdbc-adapter-52.1-java/lib/arjdbc/jdbc/connection_methods.rb:8
new_connection at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:809
checkout_new_connection at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:853
try_to_checkout_new_connection at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:832
acquire_connection at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:793
checkout at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:521
connection at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:380
retrieve_connection at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:1008
retrieve_connection at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/connection_handling.rb:118
connection at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/connection_handling.rb:90
load_schema! at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/model_schema.rb:466
load_schema! at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/attributes.rb:234
load_schema! at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/attribute_decorators.rb:51
block in load_schema at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/model_schema.rb:459
mon_synchronize at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/monitor.rb:214
load_schema at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/model_schema.rb:456
attribute_types at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/model_schema.rb:346
has_attribute? at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/attribute_methods.rb:230
aggregate_column at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/relation/calculations.rb:245
execute_simple_calculation at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/relation/calculations.rb:268
perform_calculation at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/relation/calculations.rb:238
calculate at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/relation/calculations.rb:145
count at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/relation/calculations.rb:52
size at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/relation.rb:211
at /root/anna/oracle_jdbc.rb:19
The text was updated successfully, but these errors were encountered:
This is related to #955. We're experiencing the same issues with Rails 5.2.4 using this gem.
There was a workaround that works for me locally in my development environment, where I use 'as400' for the adapter instead of 'jdbc'. I'm having an issue doing the same in my test environment where we use H2 to emulate the Oracle database.
This issue is unfortunately not going to be fixed. We recommend users of Oracle databases use the excellent (and far better-supported) oracle-enhanced adapter: https://github.com/rsim/oracle-enhanced
@annabackiyam Please look into using that adapter instead. They have much better support for Oracle than we ever did, and they are still being actively maintained.
@redconfetti We will need help to support additional databases beyond the core three. We would be very happy to work with you to re-add support for these other databases if you would help us build and maintain that support.
ArgumentError: wrong number of arguments (4 for 3)
at /root/anna/oracle_jdbc.rb:19initialize at /opt/SUN/lib/ruby/gems/gems/activerecord-jdbc-adapter-52.1-java/lib/arjdbc/abstract/core.rb:12
require 'rubygems'
new at /opt/SUN/lib/ruby/gems/gems/activerecord-jdbc-adapter-52.1-java/lib/arjdbc/jdbc/callbacks.rb:12
jdbc_connection at /opt/SUN/lib/ruby/gems/gems/activerecord-jdbc-adapter-52.1-java/lib/arjdbc/jdbc/connection_methods.rb:8
new_connection at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:809
checkout_new_connection at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:853
try_to_checkout_new_connection at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:832
acquire_connection at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:793
checkout at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:521
connection at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:380
retrieve_connection at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:1008
retrieve_connection at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/connection_handling.rb:118
connection at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/connection_handling.rb:90
load_schema! at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/model_schema.rb:466
load_schema! at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/attributes.rb:234
load_schema! at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/attribute_decorators.rb:51
block in load_schema at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/model_schema.rb:459
mon_synchronize at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/monitor.rb:214
load_schema at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/model_schema.rb:456
attribute_types at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/model_schema.rb:346
has_attribute? at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/attribute_methods.rb:230
aggregate_column at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/relation/calculations.rb:245
execute_simple_calculation at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/relation/calculations.rb:268
perform_calculation at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/relation/calculations.rb:238
calculate at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/relation/calculations.rb:145
count at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/relation/calculations.rb:52
size at /opt/SUN/lib/ruby/gems/gems/activerecord-5.2.1/lib/active_record/relation.rb:211
The text was updated successfully, but these errors were encountered: