module Sequel::JDBC::SQLServer::DatabaseMethods::MetadataDatasetMethods

  1. lib/sequel/adapters/jdbc/sqlserver.rb

Work around a bug in SQL Server JDBC Driver 3.0, where the metadata for the getColumns result set specifies an incorrect type for the IS_AUTOINCREMENT column. The column is a string, but the type is specified as a short. This causes getObject() to throw a com.microsoft.sqlserver.jdbc.SQLServerException: “The conversion from char to SMALLINT is unsupported.” Using getString() rather than getObject() for this column avoids the problem. Reference: social.msdn.microsoft.com/Forums/en/sqldataaccess/thread/20df12f3-d1bf-4526-9daa-239a83a8e435

Methods

Public Instance

  1. basic_type_convertor
  2. type_convertor

Public Instance methods

basic_type_convertor(map, meta, type, i)
[show source]
   # File lib/sequel/adapters/jdbc/sqlserver.rb
67 def basic_type_convertor(map, meta, type, i)
68   if output_identifier(meta.getColumnLabel(i)) == :is_autoincrement
69     map[Java::JavaSQL::Types::VARCHAR]
70   else
71     super
72   end
73 end
type_convertor(map, meta, type, i)
[show source]
   # File lib/sequel/adapters/jdbc/sqlserver.rb
59 def type_convertor(map, meta, type, i)
60   if output_identifier(meta.getColumnLabel(i)) == :is_autoincrement
61     map[Java::JavaSQL::Types::VARCHAR]
62   else
63     super
64   end
65 end