unsupported
  4   ˆl–ßi~”ªn-j�vãM\dJbÑ¿ŽþDÑVl¯ŒŒ‰±Œ óÍ590ÌËÊ N    €}q (X	   locale_idqX   pcm_NGqX   territoriesq}qX	   languagesq}qX   variantsq}qX   scriptsq	}q
X   list_patternsq}qX	   week_dataq}qX   zone_formatsq}qX
   time_zonesq}qX
   meta_zonesq}qX   number_symbolsq}qX   decimal_formatsq}qX   scientific_formatsq}qX   percent_formatsq}qX   currency_formatsq}qX   currency_unit_patternsq}q X   currency_namesq!}q"X   currency_names_pluralq#}q$X   currency_symbolsq%}q&X   unit_patternsq'}q(X   compound_unit_patternsq)}q*X   unit_display_namesq+}q,X   date_fieldsq-}q.X   measurement_systemsq/}q0u.  F   ˆl–äY>”ª_)%+�à€¦-ÿ�þ]ò¬ÙedŒ¾"ÈØüÿÎ„ì´ÏÍ_�uÐb&=LyZËcõÍÌ ?÷     # frozen-string-literal: true

require 'java'
require_relative 'utils/stored_procedures'

module Sequel
  module JDBC
    # Make it accesing the java.sql hierarchy more ruby friendly.
    module JavaSQL
      include_package 'java.sql'
    end

    # Used to identify a jndi connection and to extract the jndi
    # resource name.
    JNDI_URI_REGEXP = /\Ajdbc:jndi:(.+)/
    
    # Contains procs keyed on subadapter type that extend the
    # given database object so it supports the correct database type.
    DATABASE_SETUP = {}

    # Create custom NativeException alias for nicer access, and also so that
    # JRuby 9.2+ so it doesn't use the deprecated ::NativeException
    NativeException = java.lang.Exception
    
    # Default database error classes
    DATABASE_ERROR_CLASSES = [NativeException]
    if JRUBY_VERSION < '9.2'
      # On JRuby <9.2, still include ::NativeException, as it is still needed in some cases
      DATABASE_ERROR_CLASSES << ::NativeException
    end
    DATABASE_ERROR_CLASSES.freeze

    # Allow loading the necessary JDBC support via a gem.
    def self.load_gem(name)
      require "jdbc/#{name.to_s.downcase}"
    rescue LoadError
      # jdbc gem not used, hopefully the user has the .jar in their CLASSPATH
    else
      if defined?(::Jdbc) && ( ::Jdbc.const_defined?(name) rescue nil )
        jdbc_module = ::Jdbc.const_get(name) # e.g. Jdbc::SQLite3
        jdbc_module.load_driver if jdbc_module.respond_to?(:load_driver)
      end
    end

    # Attempt to load the JDBC driver class, which should be specified as a string
    # containing the driver class name (which JRuby should autoload).
    # Note that the string is evaled, so this method is not safe to call with
    # untrusted input.
    # Raise a Sequel::AdapterNotFound if evaluating the class name raises a NameError.
    def self.load_driver(drv, gem=nil)
      load_gem(gem) if gem
      if drv.is_a?(String)
        eval drv
      else
        *try, last = drv
        try.each do |try_drv|
          begin
            return eval(try_drv)
          rescue NameError
          end
        end

        eval last
      end
    rescue NameError
      raise Sequel::AdapterNotFound, "#{drv} not loaded#{", try installing jdbc-#{gem.to_s.downcase} gem" if gem}"
    end

    class TypeConvertor
      CONVERTORS = convertors = {}
      %w'Boolean Float Double Int Long Short'.each do |meth|
        x = x = convertors[meth.to_sym] = Object.new
        class_eval("def x.call(r, i) v = r.get#{meth}(i); v unless r.wasNull end", __FILE__, __LINE__)
      end
      %w'Object Array String Time Date Timestamp BigDecimal Blob Bytes Clob'.each do |meth|
        x = x = convertors[meth.to_sym] = Object.new
        class_eval("def x.call(r, i) r.get#{meth}(i) end", __FILE__, __LINE__)
      end
      x = convertors[:RubyTime] = Object.new
      def x.call(r, i)
        if v = r.getTime(i)
          Sequel.string_to_time("#{v.to_string}.#{sprintf('%03i', v.getTime.divmod(1000).last)}")
        end
      end
      x = convertors[:RubyDate] = Object.new
      def x.call(r, i)
        if v = r.getDate(i)
          Date.civil(v.getYear + 1900, v.getMonth + 1, v.getDate)
        end
      end
      x = convertors[:RubyTimestamp] = Object.new
      def x.call(r, i)
        if v = r.getTimestamp(i)
          Sequel.database_