Module: Jdbc::Mssql

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

Constant Summary collapse

VERSION =
'12.2.0'.freeze

Class Method Summary collapse

Class Method Details

.driver_versionObject



15
16
17
# File 'lib/jdbc/mssql.rb', line 15

def self.driver_version
  '12.2.0'
end

.effective_jre_versionObject



19
20
21
22
23
24
25
# File 'lib/jdbc/mssql.rb', line 19

def self.effective_jre_version
  if jre_version >= 11
    11
  elsif jre_version == 8
    8
  end
end

.jar_fileObject



27
28
29
# File 'lib/jdbc/mssql.rb', line 27

def self.jar_file
  "mssql-jdbc-#{driver_version}.jre#{effective_jre_version}.jar"
end

.java_specification_versionObject



7
8
9
# File 'lib/jdbc/mssql.rb', line 7

def self.java_specification_version
  ENV_JAVA['java.specification.version']
end

.jre_versionObject



11
12
13
# File 'lib/jdbc/mssql.rb', line 11

def self.jre_version
  java_specification_version.split('.').last.to_i
end

.load_driverObject



31
32
33
34
35
36
37
# File 'lib/jdbc/mssql.rb', line 31

def self.load_driver
  warn 'loading JDBC driver on require "jdbc/mssql"' if $VERBOSE

  raise 'No JDBC driver for your java version' unless jre_version > 7

  require jar_file
end