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 19
19
import io .grpc .netty .shaded .io .netty .util .collection .IntObjectMap ;
20
20
21
21
import tech .ydb .jdbc .YdbConst ;
22
+ import tech .ydb .jdbc .YdbJdbcCode ;
22
23
import tech .ydb .table .values .DecimalType ;
23
24
import tech .ydb .table .values .DecimalValue ;
24
25
import tech .ydb .table .values .PrimitiveType ;
@@ -37,11 +38,15 @@ public class YdbTypes {
37
38
private YdbTypes () {
38
39
typeBySqlType = new IntObjectHashMap <>(18 + PrimitiveType .values ().length );
39
40
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 ()) {
42
43
typeBySqlType .put (YdbConst .SQL_KIND_PRIMITIVE + type .ordinal (), type );
43
44
}
44
45
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
+
45
50
typeBySqlType .put (Types .VARCHAR , PrimitiveType .Text );
46
51
typeBySqlType .put (Types .BIGINT , PrimitiveType .Int64 );
47
52
typeBySqlType .put (Types .TINYINT , PrimitiveType .Int8 );
You can’t perform that action at this time.
0 commit comments