Guest User

Untitled

a guest
Apr 9th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. # gems you need
  2. #
  3. # dbi
  4. # dbd-jdbc
  5. # jdbc-postgres
  6.  
  7. require 'java'
  8.  
  9. require 'rubygems'
  10. require 'dbi'
  11. require 'dbd/Jdbc'
  12. require 'jdbc/postgres'
  13.  
  14. # connect to database 'foobar'
  15. # with user 'foobar' and password 'quux'
  16. DBI.connect('DBI:Jdbc:postgresql://localhost/foobar',
  17. 'foobar', 'quux',
  18. 'driver' => 'org.postgresql.Driver') do |dbh|
  19. puts "Connected"
  20.  
  21. end
Add Comment
Please, Sign In to add comment