diff --git a/README.md b/README.md index 9279b406..dc0be18c 100644 --- a/README.md +++ b/README.md @@ -135,7 +135,7 @@ or include gem in Gemfile if using bundler. In addition install either ruby-oci8 (for MRI/YARV) or copy Oracle JDBC driver to $JRUBY_HOME/lib (for JRuby). -If you are using MRI Ruby implementation then you need to install ruby-oci8 gem (version 2.0.x or 2.1.x) +If you are using MRI Ruby implementation then you need to install ruby-oci8 gem (version 2.1 or higher) as well as Oracle client, e.g. [Oracle Instant Client](http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html). If you are using JRuby then you need to download latest [Oracle JDBC driver](http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-112010-090769.html) - either ojdbc7.jar for Java 8 and 7, ojdbc6.jar for Java 6, 7, 8 or ojdbc5.jar for Java 5. You can refer [the support matrix](http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-faq-090281.html#01_03) for details. diff --git a/lib/plsql/oci8_patches.rb b/lib/plsql/oci8_patches.rb deleted file mode 100644 index 66d1e413..00000000 --- a/lib/plsql/oci8_patches.rb +++ /dev/null @@ -1,25 +0,0 @@ -# apply TIMESTAMP fractional seconds patch to ruby-oci8 2.0.3 -# see http://rubyforge.org/forum/forum.php?thread_id=46576&forum_id=1078 -if OCI8::VERSION == "2.0.3" && - !OCI8::BindType::Util.method_defined?(:datetime_to_array_without_timestamp_patch) - - OCI8::BindType::Util.module_eval do - alias :datetime_to_array_without_timestamp_patch :datetime_to_array - def datetime_to_array(val, full) - result = datetime_to_array_without_timestamp_patch(val, full) - if result && result[6] == 0 - if val.respond_to? :nsec - fsec = val.nsec - elsif val.respond_to? :usec - fsec = val.usec * 1000 - else - fsec = 0 - end - result[6] = fsec - end - result - end - private :datetime_to_array_without_timestamp_patch, :datetime_to_array - end - -end diff --git a/lib/plsql/oci_connection.rb b/lib/plsql/oci_connection.rb index ca5e9bee..168a9b40 100644 --- a/lib/plsql/oci_connection.rb +++ b/lib/plsql/oci_connection.rb @@ -14,13 +14,9 @@ raise LoadError, "ERROR: ruby-plsql could not load ruby-oci8 library. #{msg}" end -require "plsql/oci8_patches" - # check ruby-oci8 version -required_oci8_version = [2, 0, 3] -oci8_version_ints = OCI8::VERSION.scan(/\d+/).map { |s| s.to_i } -if (oci8_version_ints <=> required_oci8_version) < 0 - raise LoadError, "ERROR: ruby-oci8 version #{OCI8::VERSION} is too old. Please install ruby-oci8 version #{required_oci8_version.join('.')} or later." +if Gem::Version.new(OCI8::VERSION) < Gem::Version.new("2.1.0") + raise LoadError, "ERROR: ruby-oci8 version #{OCI8::VERSION} is too old. Please install ruby-oci8 version 2.1.0 or later." end module PLSQL