File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed
jdbc/src/main/java/tech/ydb/jdbc Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 1+ package tech .ydb .jdbc ;
2+
3+ /**
4+ * @author Kirill Kurdyukov
5+ */
6+ public class YdbJdbcCode {
7+
8+ private YdbJdbcCode () {
9+ }
10+
11+ public static final int DECIMAL_22_9 = 10024 ;
12+
13+ public static final int DECIMAL_31_9 = 10025 ;
14+
15+ public static final int DECIMAL_35_9 = 10026 ;
16+ }
Original file line number Diff line number Diff line change 1919import io .grpc .netty .shaded .io .netty .util .collection .IntObjectMap ;
2020
2121import tech .ydb .jdbc .YdbConst ;
22+ import tech .ydb .jdbc .YdbJdbcCode ;
2223import tech .ydb .table .values .DecimalType ;
2324import tech .ydb .table .values .DecimalValue ;
2425import tech .ydb .table .values .PrimitiveType ;
@@ -37,11 +38,15 @@ public class YdbTypes {
3738 private YdbTypes () {
3839 typeBySqlType = new IntObjectHashMap <>(18 + PrimitiveType .values ().length );
3940
40- // Store custom type ids to use it for PrepaparedStatement .setObject
41- for (PrimitiveType type : PrimitiveType .values ()) {
41+ // Store custom type ids to use it for PreparedStatement .setObject
42+ for (PrimitiveType type : PrimitiveType .values ()) {
4243 typeBySqlType .put (YdbConst .SQL_KIND_PRIMITIVE + type .ordinal (), type );
4344 }
4445
46+ typeBySqlType .put (YdbJdbcCode .DECIMAL_22_9 , DecimalType .of (22 , 9 ));
47+ typeBySqlType .put (YdbJdbcCode .DECIMAL_31_9 , DecimalType .of (31 , 9 ));
48+ typeBySqlType .put (YdbJdbcCode .DECIMAL_35_9 , DecimalType .of (35 , 9 ));
49+
4550 typeBySqlType .put (Types .VARCHAR , PrimitiveType .Text );
4651 typeBySqlType .put (Types .BIGINT , PrimitiveType .Int64 );
4752 typeBySqlType .put (Types .TINYINT , PrimitiveType .Int8 );
You can’t perform that action at this time.
0 commit comments