Guest User

Untitled

a guest
Aug 25th, 2014
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.39 KB | None | 0 0
  1. require 'sqlite3'
  2.  
  3. class Warehouse
  4.  
  5.   def initialize
  6.  
  7.     begin
  8.  
  9.       db = SQLite3::Database.new '/home/shachar/bin/RubyMine-6.3.3/bin/Warehouse.db'
  10.       rescue SQLite3::Exception => e
  11.  
  12.       puts 'Exception occured'
  13.       puts e
  14.  
  15.     ensure
  16.       db.close if db
  17.     end
  18.  
  19.   end
  20.  
  21.     def get_value
  22.       puts db.get_first_row('select * from "Products"')
  23.     end
  24.  
  25.  
  26. end
Advertisement
Add Comment
Please, Sign In to add comment