Method: Sequel::JDBC.load_gem
- Defined in:
- lib/sequel/adapters/jdbc.rb
.load_gem(name) ⇒ Object
Allow loading the necessary JDBC support via a gem.
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/sequel/adapters/jdbc.rb', line 34 def self.load_gem(name) require "jdbc/#{name.to_s.downcase}" rescue LoadError # jdbc gem not used, hopefully the user has the .jar in their CLASSPATH else if defined?(::Jdbc) && ( ::Jdbc.const_defined?(name) rescue nil ) jdbc_module = ::Jdbc.const_get(name) # e.g. Jdbc::SQLite3 jdbc_module.load_driver if jdbc_module.respond_to?(:load_driver) end end |