Method: Sequel::JDBC.load_driver
- Defined in:
- lib/sequel/adapters/jdbc.rb
.load_driver(drv, gem = nil) ⇒ Object
Attempt to load the JDBC driver class, which should be specified as a string containing the driver class name (which JRuby should autoload). Note that the string is evaled, so this method is not safe to call with untrusted input. Raise a Sequel::AdapterNotFound if evaluating the class name raises a NameError.
55 56 57 58 59 60 |
# File 'lib/sequel/adapters/jdbc.rb', line 55 def self.load_driver(drv, gem=nil) load_gem(gem) if gem eval drv rescue NameError raise Sequel::AdapterNotFound, "#{drv} not loaded#{", try installing jdbc-#{gem.to_s.downcase} gem" if gem}" end |