« Return to Thread: Getting a java connection from ar-jdbc

Re: Getting a java connection from ar-jdbc

by rjst :: Rate this Message:

Reply to Author | View in Thread

Hi,

    I couldn't do it the way you sugested, but this worked :

    connection = ActiveRecord::Base.connection.connection.connection_factory.connect

    However, I had to add a 'attr_reader :connection' to JdbcAdapter. I'm using version 0.7.2.

thanks,
Ricardo

Nick Sieger wrote:
On Thu, Jul 17, 2008 at 9:51 AM, Ricardo Trindade
ricardo.trindade@... wrote:
  
Hi,

  I'm using rails with AR-JDBC. Since my rails apps uses some libraries that
require I give them jdbc connections, I'm wondering if there's a way to get
a java db connection from it ?
    

Sure, I think ActiveRecord::Base.connection.connection should give you
the JDBC connection object.

/Nick

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



  

--

 « Return to Thread: Getting a java connection from ar-jdbc

LightInTheBox - Buy quality products at wholesale price!