Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7887585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:37:06+00:00 2026-06-03T05:37:06+00:00

I am using JRuby 1.6.7, ActiveRecord 3.2.3, activerecord-jdbc-adapter 1.2.2, activerecord-jdbcsqlanywhere-adapter-1.1.1 and the current Sybase

  • 0

I am using JRuby 1.6.7, ActiveRecord 3.2.3, activerecord-jdbc-adapter 1.2.2, activerecord-jdbcsqlanywhere-adapter-1.1.1 and the current Sybase JDBC4 driver. Using a full Ruby On Rails application is not an option at this time. I am getting the following error when I run my unit tests.


    NoMethodError: undefined method `find_by_configuration_name' for #
      method_missing at org/jruby/RubyBasicObject.java:1687
      method_missing at /home/lynchcs/.rvm/gems/jruby-1.6.5.1/gems/activerecord-3.2.3/lib/active_record/dynamic_matchers.rb:27

I am able to perform a schema dump in my unit tests which correctly identifies the table. Here is the schema for the table.



      create_table "THE_CONFIGURATION", :primary_key => "CONFIGURATION_ID", :force => true do |t|
        t.string "CONFIGURATION_GROUP", :limit => 32
        t.string "CONFIGURATION_TYPE",  :limit => 32
        t.string "CONFIGURATION_NAME",  :limit => 32
        t.string "CONFIGURATION_TEXT",  :limit => 7168
      end

Here is the model I built for it.



    require 'rubygems'
    require 'active_record'

    class Configuration < ActiveRecord::Base
      self.table_name = 'SOART_CONFIGURATION'
      self.primary_key = 'configuration_id'
    end

Here is the class I used to manage my connections. This class does successfully connect to the database and execute the query.



    require 'java'
    require 'rubygems'
    require 'active_record'

    class ConnectionMaster
      def test_object
        "ARBITRARY"
      end

      def set_connection
        ActiveRecord::Base.establish_connection(
        :adapter => 'jdbc' ,
        :driver => 'com.sybase.jdbc4.jdbc.SybDriver' ,
        :url => 'jdbc:sybase:Tds:192.168.137.137:1111/MYAPP' ,
        :username => 'noneya' ,
        :password => 'noneya'
        )
        ActiveRecord::Base.connection.execute("SELECT 'ARBITRARY' AS ARBITRARY")
      end

      def clear_connections
        ActiveRecord::Base.clear_active_connections!
      end

    end

It will error when “config = Configuration.find_by_configuration_name(‘test’)” is executed. If you comment out this line it will error out on the “config.configuration_text” line.



      public void testRubyDatabaseQuery() {
        String theValue = "test";
        String jrubyCode =
        "require 'connection_master' \n"
        + "require 'configuration' \n"
        + "cm = ConnectionMaster.new \n"
        + "cm.set_connection \n"
        + "puts 'black cow of revenge' \n"
        + "config = Configuration.find(:all,:conditions => ['configuration_name=?','test']) \n"
        + "config = Configuration.find_by_configuration_name('test') \n"
        + "puts 'red cow of revenge' \n"
        + "cm.clear_connections \n"
        + "config.configuration_text \n";
        String executeValue = (String)JRubyMaster.execute(jrubyCode);
        this.assertEquals("executeValue and theValue do not match.", theValue, executeValue);
      }

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T05:37:07+00:00Added an answer on June 3, 2026 at 5:37 am

    While building the question I found my own answer:) I felt it was interesting enough to go ahead to post both question and answer.

    In my first effort I used activerecord-jdbc-adapter and the problem was I was using “Configuration.find_by_configuration_name” and what it was building was “Configuration.find_by_CONFIGURATION_NAME” the same for “config.configuration_text”. The column names where capitalized in the database and activerecord-jdbc-adapter created the methods with the capitalization. Once that change was made it started throwing and invalid sql error due to the use of “LIMIT”.

    I then switched to using activerecord-jdbcsqlanywhere-adapter and it worked with “Configuration.find_by_configuration_name” and “config.configuration_text” but the unit test was then failing. This was due to it building “returnValue[0][‘arbitrary’]” rather than “returnValue[0][‘ARBITRARY’]” despite that my query was “SELECT ‘ARBITRARY’ AS ARBITRARY”. activerecord-jdbcsqlanywhere-adapter is forcing everything to be lowercase.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background: I want to deploy a small JRuby-On-Rails-Application using warblers executable war, so I
I have developed a Ruby on Rails application and successfully deployed on Weblogic using
I'm using Netbeans and JRuby to develop a Rails web application. But for deployment,
I'm trying to get mysql gem installed for use on rails, using jruby, can't
I creating a site in JRuby on Rails (JRuby 1.3.0 ). I am using
I installed Ubuntu, GlassFish web server, installed JRuby on Rails using GlassFish's admin tools,
I wonder what the REST API clients are available for using from Ruby (not
I have a jruby/rails app using: jruby 1.4.0 Rails 2.3.5 ActiveMQ 5.3.0 Mule ESB
I have a simple Rails 3.1 CRUD app built using Oracle running on JRuby.
Does heroku support jruby. I am trying to implement a Rails 3.2.3 app using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.