Module: Jdbc::Postgres

Defined in:
lib/jdbc/postgres.rb,
lib/jdbc/postgres/version.rb

Constant Summary collapse

DRIVER_VERSION =
'42.2.14'
VERSION =
DRIVER_VERSION

Class Method Summary collapse

Class Method Details

.driver_jarObject


6
7
8
9
10
11
# File 'lib/jdbc/postgres.rb', line 6

def self.driver_jar
  version_jre_version = DRIVER_VERSION.split( '.' )
  version = jre_version
  version_jre_version << (version ? ".jre#{version}" : '')
  'postgresql-%s.%s.%s%s.jar' % version_jre_version
end

.driver_nameObject


23
24
25
# File 'lib/jdbc/postgres.rb', line 23

def self.driver_name
  'org.postgresql.Driver'
end

.load_driver(method = :load) ⇒ Object


13
14
15
16
17
18
19
20
21
# File 'lib/jdbc/postgres.rb', line 13

def self.load_driver(method = :load)
  send method, driver_jar
rescue LoadError => e
  if (version = jre_version) && version < 6
    warn "failed to load postgresql (driver) jar, please note that we no longer " <<
             "include JDBC 3.x support, on Java < 6 please use gem 'jdbc-postgres', '~> 9.2'"
  end
  raise e
end