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

  • Home
  • SEARCH
  • 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 9139237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:21:41+00:00 2026-06-17T09:21:41+00:00

I am using Jruby and Rails 3 with jxls , a Java library to

  • 0

I am using Jruby and Rails 3 with jxls, a Java library to generate reports in Excel.

The jxls API has a ReportManagerImpl which takes a java.sql.Connection in its constructor.

ReportManager reportManager = new ReportManagerImpl( conn, beans );

In my non-working code, ReportQuery is a ActiveRecord object. The Jruby looks like this:

conn = ReportQuery.connection
rm = Java::NetSfJxlsReport::ReportManagerImpl.new(conn, params)

But ActiveRecord::Base.connection returns not a java.sql.Connection, but a ActiveRecord::ConnectionAdapters::JdbcAdapter.

How can I access the underlying java.sql.Connection object from JRuby?

The error message I get is:

2012-12-28 17:28:08,000 [main] WARN org.apache.commons.jexl2.JexlEngine - ![3,149]: 'rm.exec('SELECT d.name depname, e.name empname, age, payment, bonus, birthDate FROM employee e, department d where d.id = e.depid order by age desc');' method invocation error org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `createStatement' for #<ActiveRecord::ConnectionAdapters::JdbcAdapter:0x13ba673> 
  • 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-17T09:21:42+00:00Added an answer on June 17, 2026 at 9:21 am

    Use .jdbc_connection method on a ActiveRecord connection to access the raw JDBC connection in JRuby:

    ActiveRecord::Base.connection.jdbc_connection
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

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 am using rvm rvm list rvm rubies jruby-1.5.0 [ i386-java ] jruby-1.5.1 [
I have a jruby/rails app using: jruby 1.4.0 Rails 2.3.5 ActiveMQ 5.3.0 Mule ESB
I want to export some data from my jruby on rails webapp to excel,
I have a jruby rails app and I've just started using bundler for gem
I just started using JRuby and I create a small test file: require 'java'
I am using jruby-1.6.6 with rails 3.2 currently. And I am using gem 'bootstrap-sass',
I am using jruby, i want use pagination for my rails app i used

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.