class Sequel::JDBC::TypeConvertor

Constants

BASIC_MAP
MAP

Public Instance Methods

RubyBigDecimal(r, i) click to toggle source
# File lib/sequel/adapters/jdbc.rb, line 81
def RubyBigDecimal(r, i)
  if v = r.getBigDecimal(i)
    ::Kernel::BigDecimal(v.to_string)
  end
end
RubyBlob(r, i) click to toggle source
# File lib/sequel/adapters/jdbc.rb, line 86
def RubyBlob(r, i)
  if v = r.getBytes(i)
    Sequel::SQL::Blob.new(String.from_java_bytes(v))
  end
end
RubyClob(r, i) click to toggle source
# File lib/sequel/adapters/jdbc.rb, line 91
def RubyClob(r, i)
  if v = r.getClob(i)
    v.getSubString(1, v.length)
  end
end
RubyDate(r, i) click to toggle source
# File lib/sequel/adapters/jdbc.rb, line 71
def RubyDate(r, i)
  if v = r.getDate(i)
    Date.civil(v.getYear + 1900, v.getMonth + 1, v.getDate)
  end
end
RubyTime(r, i) click to toggle source
# File lib/sequel/adapters/jdbc.rb, line 66
def RubyTime(r, i)
  if v = r.getTime(i)
    Sequel.string_to_time("#{v.to_string}.#{sprintf('%03i', v.getTime.divmod(1000).last)}")
  end
end
RubyTimestamp(r, i) click to toggle source
# File lib/sequel/adapters/jdbc.rb, line 76
def RubyTimestamp(r, i)
  if v = r.getTimestamp(i)
    Sequel.database_to_application_timestamp([v.getYear + 1900, v.getMonth + 1, v.getDate, v.getHours, v.getMinutes, v.getSeconds, v.getNanos])
  end
end