Class | Sequel::Dataset::TYPE_TRANSLATOR
In: | lib/sequel/adapters/jdbc.rb lib/sequel/adapters/jdbc/h2.rb lib/sequel/adapters/jdbc/oracle.rb lib/sequel/adapters/jdbc/jtds.rb
Parent: | Object

JAVA_H2_CLOB = Java::OrgH2Jdbc::JdbcClob

### Methods

blob buffered_reader byte_array clob date decimal h2_clob jtds_clob oracle_decimal time

### Constants

LF | = | "\n".freeze

### Public Instance methods

blob(v)

[Source]

         # File lib/sequel/adapters/jdbc.rb, line 629
    629:         def blob(v) Sequel::SQL::Blob.new(String.from_java_bytes(v.getBytes(1, v.length))) end

buffered_reader(v)

[Source]

         # File lib/sequel/adapters/jdbc.rb, line 631
    631:         def buffered_reader(v)
    632:           lines = ""
    633:           c = false
    634:           while(line = v.read_line) do
    635:             lines << LF if c
    636:             lines << line
    637:             c ||= true
    638:           end
    639:           lines
    640:         end

byte_array(v)

[Source]

         # File lib/sequel/adapters/jdbc.rb, line 628
    628:         def byte_array(v) Sequel::SQL::Blob.new(String.from_java_bytes(v)) end

clob(v)

[Source]

         # File lib/sequel/adapters/jdbc.rb, line 630
    630:         def clob(v) Sequel::SQL::Blob.new(v.getSubString(1, v.length)) end

date(v)

[Source]

         # File lib/sequel/adapters/jdbc.rb, line 626
    626:         def date(v) Date.civil(v.getYear + 1900, v.getMonth + 1, v.getDate) end

decimal(v)

[Source]

         # File lib/sequel/adapters/jdbc.rb, line 627
    627:         def decimal(v) BigDecimal.new(v.to_string) end

h2_clob(v)

[Source]

         # File lib/sequel/adapters/jdbc/h2.rb, line 175
    175:           def h2_clob(v) v.getSubString(1, v.length) end

jtds_clob(v)

[Source]

        # File lib/sequel/adapters/jdbc/jtds.rb, line 18
    18:           def jtds_clob(v) Sequel::SQL::Blob.new(v.getSubString(1, v.length)) end

oracle_decimal(v)

[Source]

        # File lib/sequel/adapters/jdbc/oracle.rb, line 80
    80:           def oracle_decimal(v)
    81:             if v.scale == 0
    82:               i = v.long_value
    83:               if v.equals(JAVA_BIG_DECIMAL.new(i))
    84:                 i
    85:               else
    86:                 decimal(v)
    87:               end
    88:             else
    89:               decimal(v)
    90:             end
    91:           end

time(v)

[Source]

         # File lib/sequel/adapters/jdbc.rb, line 625
    625:         def time(v) Sequel.string_to_time(v.to_string) end

[Validate]