Reputation: 4360
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?
Upvotes: 4
Views: 2252
Reputation: 12149
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
Upvotes: 10