4
require 'sequel'
require 'jdbc/postgres'
DB = Sequel.connect("jdbc:postgresql://user:pass@domain/database")
DB.tables

Returns:

....(bla bla bla stack trace bla bla bla)....
Sequel::DatabaseConnectionError: Java::OrgPostgresqlUtil::PSQLException: The connection attempt failed.
...........

I have also tried

jdbc:postgresql://domain/database?user=name&pass=word 

and got an error as well, but a different one('password requested but not provided')

ruby 1.9.3 - jruby 1.7.3

I have looked and looked, tried many code samples, but I am unable to get Sequel working So, How do I get Sequel to interface with postgres while using jruby?

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
Shelvacu
  • 4,245
  • 25
  • 44

1 Answers1

10

Sequel passes a jdbc connection string directly to JDBC, so there is nothing Sequel-specific about it. You probably want something like jdbc:postgresql://domain/database?user=name&password=secret

Jeremy Evans
  • 11,959
  • 27
  • 26