Пример #1
0
        public DB2DataProvider(string name, DB2Version version)
            : base(name, null)
        {
            Version = version;

            SqlProviderFlags.AcceptsTakeAsParameter       = false;
            SqlProviderFlags.AcceptsTakeAsParameterIfSkip = true;
            SqlProviderFlags.IsDistinctOrderBySupported   = version != DB2Version.zOS;

            SetCharField("CHAR", (r, i) => r.GetString(i).TrimEnd(' '));

            _sqlOptimizer = new DB2SqlOptimizer(SqlProviderFlags);
        }
Пример #2
0
        public DB2DataProvider(string name, DB2Version version)
            : base(name, null)
        {
            Version = version;

            SqlProviderFlags.AcceptsTakeAsParameter            = false;
            SqlProviderFlags.AcceptsTakeAsParameterIfSkip      = true;
            SqlProviderFlags.IsDistinctOrderBySupported        = false;
            SqlProviderFlags.IsCommonTableExpressionsSupported = true;

            SetCharFieldToType <char>("CHAR", (r, i) => DataTools.GetChar(r, i));

            SetCharField("CHAR", (r, i) => r.GetString(i).TrimEnd(' '));

            _sqlOptimizer = new DB2SqlOptimizer(SqlProviderFlags);
        }
Пример #3
0
        public DB2DataProvider(string name, DB2Version version)
            : base(
                name,
                GetMappingSchema(version, DB2ProviderAdapter.GetInstance().MappingSchema),
                DB2ProviderAdapter.GetInstance())

        {
            Version = version;

            SqlProviderFlags.AcceptsTakeAsParameter            = false;
            SqlProviderFlags.AcceptsTakeAsParameterIfSkip      = true;
            SqlProviderFlags.IsDistinctOrderBySupported        = false;
            SqlProviderFlags.IsCommonTableExpressionsSupported = true;
            SqlProviderFlags.IsUpdateFromSupported             = false;

            SetCharFieldToType <char>("CHAR", (r, i) => DataTools.GetChar(r, i));
            SetCharField("CHAR", (r, i) => r.GetString(i).TrimEnd(' '));

            _sqlOptimizer = new DB2SqlOptimizer(SqlProviderFlags);

            SetProviderField(Adapter.DB2Int64Type, typeof(long), Adapter.GetDB2Int64ReaderMethod, dataReaderType: Adapter.DataReaderType);
            SetProviderField(Adapter.DB2Int32Type, typeof(int), Adapter.GetDB2Int32ReaderMethod, dataReaderType: Adapter.DataReaderType);
            SetProviderField(Adapter.DB2Int16Type, typeof(short), Adapter.GetDB2Int16ReaderMethod, dataReaderType: Adapter.DataReaderType);
            SetProviderField(Adapter.DB2DecimalType, typeof(decimal), Adapter.GetDB2DecimalReaderMethod, dataReaderType: Adapter.DataReaderType);
            SetProviderField(Adapter.DB2DecimalFloatType, typeof(decimal), Adapter.GetDB2DecimalFloatReaderMethod, dataReaderType: Adapter.DataReaderType);
            SetProviderField(Adapter.DB2RealType, typeof(float), Adapter.GetDB2RealReaderMethod, dataReaderType: Adapter.DataReaderType);
            SetProviderField(Adapter.DB2Real370Type, typeof(float), Adapter.GetDB2Real370ReaderMethod, dataReaderType: Adapter.DataReaderType);
            SetProviderField(Adapter.DB2DoubleType, typeof(double), Adapter.GetDB2DoubleReaderMethod, dataReaderType: Adapter.DataReaderType);
            SetProviderField(Adapter.DB2StringType, typeof(string), Adapter.GetDB2StringReaderMethod, dataReaderType: Adapter.DataReaderType);
            SetProviderField(Adapter.DB2ClobType, typeof(string), Adapter.GetDB2ClobReaderMethod, dataReaderType: Adapter.DataReaderType);
            SetProviderField(Adapter.DB2BinaryType, typeof(byte[]), Adapter.GetDB2BinaryReaderMethod, dataReaderType: Adapter.DataReaderType);
            SetProviderField(Adapter.DB2BlobType, typeof(byte[]), Adapter.GetDB2BlobReaderMethod, dataReaderType: Adapter.DataReaderType);
            SetProviderField(Adapter.DB2DateType, typeof(DateTime), Adapter.GetDB2DateReaderMethod, dataReaderType: Adapter.DataReaderType);
            SetProviderField(Adapter.DB2TimeType, typeof(TimeSpan), Adapter.GetDB2TimeReaderMethod, dataReaderType: Adapter.DataReaderType);
            SetProviderField(Adapter.DB2TimeStampType, typeof(DateTime), Adapter.GetDB2TimeStampReaderMethod, dataReaderType: Adapter.DataReaderType);
            SetProviderField(Adapter.DB2XmlType, typeof(string), Adapter.GetDB2XmlReaderMethod, dataReaderType: Adapter.DataReaderType);
            SetProviderField(Adapter.DB2RowIdType, typeof(byte[]), Adapter.GetDB2RowIdReaderMethod, dataReaderType: Adapter.DataReaderType);

            if (Adapter.DB2DateTimeType != null)
            {
                SetProviderField(Adapter.DB2DateTimeType, typeof(DateTime), Adapter.GetDB2DateTimeReaderMethod !, dataReaderType: Adapter.DataReaderType);
            }
        }