Sha256: db81e746430f2dbf4a9a6a84ea52e1c2cf34eb833148246ce61872d5ff710e91

Contents?: true

Size: 614 Bytes

Versions: 1

Compression:

Stored size: 614 Bytes

Contents

module Jdbc
  module Postgres
    VERSION = "9.1.901"

    def self.require_driver_jar
      vers  = VERSION.split( '.' )
      vers << jdbc_version
      require( "postgresql-%s.%s-%s.jdbc%d.jar" % vers )
    end

    # JDBC version 4 if Java >=1.6, else 3
    def self.jdbc_version
      vers = Java::java.lang.System::get_property( "java.specification.version" )
      vers = vers.split( '.' ).map { |v| v.to_i }
      ( ( vers <=> [ 1, 6 ] ) >= 0 ) ? 4 : 3
    end

  end
end

if RUBY_PLATFORM =~ /java/
  Jdbc::Postgres::require_driver_jar
elsif $VERBOSE
  warn "jdbc-postgres is only for use with JRuby"
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jdbc-postgres-9.1.901 lib/jdbc/postgres.rb