lib/jdbc/derby.rb in jdbc-derby-10.8.2.2 vs lib/jdbc/derby.rb in jdbc-derby-10.8.3.0

- old
+ new

@@ -1,21 +1,27 @@ +warn "Jdbc-Derby is only for use with JRuby" if (JRUBY_VERSION.nil? rescue true) + module Jdbc module Derby - VERSION = "10.8.2.2" + DRIVER_VERSION = "10.8.3.0" + VERSION = DRIVER_VERSION + '' def self.driver_jar - "derby-#{VERSION}.jar" + "derby-#{DRIVER_VERSION}.jar" end def self.load_driver(method = :load) send method, driver_jar end def self.driver_name 'org.apache.derby.jdbc.EmbeddedDriver' end - end -end -if $VERBOSE && (JRUBY_VERSION.nil? rescue true) - warn "Jdbc-Derby is only for use with JRuby" + if defined?(JRUBY_VERSION) && # enable backwards-compat behavior : + ( Java::JavaLang::Boolean.get_boolean("jdbc.driver.autoload") || + Java::JavaLang::Boolean.get_boolean("jdbc.derby.autoload") ) + warn "autoloading JDBC driver on require 'jdbc/derby'" if $VERBOSE + load_driver :require + end + end end