test integration changes
[csql.git] / src / jdbc / Util.java
blob472b6aec4bf62a994d762ee7bb6fa86cc94e8766
1 /*
2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
4 */
6 package csql.jdbc;
8 import java.sql.Types;
10 /**
12 * @author bijaya
14 public class Util
16 public static int getType(int csqltype)
18 switch(csqltype)
20 case 0:
21 return Types.INTEGER ;
22 case 1:
23 return Types.BIGINT ;
24 case 2:
25 return Types.BIGINT ;
26 case 3:
27 return Types.SMALLINT ;
28 case 4:
29 return Types.TINYINT ;
31 case 10:
32 return Types.DOUBLE ;
33 case 11:
34 return Types.FLOAT ;
35 case 12:
36 return Types.DECIMAL ;
38 case 20:
39 return Types.DATE ;
40 case 21:
41 return Types.TIME ;
42 case 22:
43 return Types.TIMESTAMP ;
45 case 30:
46 return Types.CHAR ;
47 case 31:
48 return Types.BINARY ;
50 case 100 :
52 default:
53 return Types.OTHER;
57 public static String getTypeName(int csqltype)
59 switch(csqltype)
61 case 0:
62 return "INT";
63 case 1:
64 return "BIGINT" ;
65 case 2:
66 return "BIGINT" ;
67 case 3:
68 return "SMALLINT" ;
69 case 4:
70 return "TINYINT" ;
72 case 10:
73 return "DOUBLE" ;
74 case 11:
75 return "FLOAT" ;
76 case 12:
77 return "DECIMAL" ;
79 case 20:
80 return "DATE" ;
81 case 21:
82 return "TIME" ;
83 case 22:
84 return "TIMESTAMP" ;
86 case 30:
87 return "CHAR" ;
88 case 31:
89 return "BINARY";
91 case 100 :
93 default:
94 return "UNKNOWN";
98 public static String getClassName(int type)
100 switch(type)
102 case 0:
103 return "java.lang.Integer";
104 case 1:
105 return "java.lang.Long" ;
106 case 2:
107 return "java.lang.Long" ;
108 case 3:
109 return "java.lang.Integer" ;
110 case 4:
111 return "java.lang.Integer" ;
113 case 10:
114 return "java.lang.Double" ;
115 case 11:
116 return "java.lang.Float" ;
117 case 12:
118 return "java.lang.Double";
120 case 20:
121 return "java.sql.Date" ;
122 case 21:
123 return "java.sql.Time" ;
124 case 22:
125 return "java.sql.Timestamp" ;
127 case 30:
128 return "java.lang.String" ;
129 case 31:
130 return "java.lang.String" ;
132 case 100 :
134 default:
135 return "UNKNOWN";