Forum: JRuby Accessing PostgreSQL database

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C704ed8d173aeaf8ebc6d1c621fc9196?d=identicon&s=25 San Ksh (sanksh)
on 2014-01-26 04:45
Hi
I am trying to access postgreSQL from jruby using postgres-pr. I have
installed it using gem. I am using following code:

require 'java'
require 'postgres-pr/connection'

conn= Connection.new('postgres', 'postgres')
res=conn.query('select * from hoom.test')

The error I am getting is:

NameError: uninitialized constant Connection
  const_missing at org/jruby/RubyModule.java:2690
         (root) at jdbConnect.rb:5

The code I am running is from this link

http://www.postgresql.org/message-id/1100799064.13...

Thanks for help in advance
This topic is locked and can not be replied to.