Sha256: d7b4c1ce5d223b80836dab3838725fddab2b5462ed87d9e712489da1e46e902c

Contents?: true

Size: 1.05 KB

Versions: 4

Compression:

Stored size: 1.05 KB

Contents

Sequel.require 'adapters/jdbc/mssql'

module Sequel
  module JDBC
    # Database and Dataset instance methods for JTDS specific
    # support via JDBC.
    module JTDS
      module DatabaseMethods
        include Sequel::JDBC::MSSQL::DatabaseMethods

        private

        # Handle nil values by using setNull with the correct parameter type.
        def set_ps_arg_nil(cps, i)
          cps.setNull(i, cps.getParameterMetaData.getParameterType(i))
        end
      end

      # Dataset class for JTDS datasets accessed via JDBC.
      class Dataset < JDBC::Dataset
        include Sequel::MSSQL::DatasetMethods

        class ::Sequel::JDBC::Dataset::TYPE_TRANSLATOR
          def jtds_clob(v) v.getSubString(1, v.length) end
        end

        JTDS_CLOB_METHOD = TYPE_TRANSLATOR_INSTANCE.method(:jtds_clob)
      
        # Handle CLOB types retrieved via JTDS.
        def convert_type_proc(v)
          if v.is_a?(Java::NetSourceforgeJtdsJdbc::ClobImpl)
            JTDS_CLOB_METHOD
          else
            super
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sequel-3.44.0 lib/sequel/adapters/jdbc/jtds.rb
sequel-3.43.0 lib/sequel/adapters/jdbc/jtds.rb
sequel-3.42.0 lib/sequel/adapters/jdbc/jtds.rb
sequel-3.41.0 lib/sequel/adapters/jdbc/jtds.rb