-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDTypes.java
More file actions
75 lines (57 loc) · 1.27 KB
/
DTypes.java
File metadata and controls
75 lines (57 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package backup;
import java.util.*;
public class DTypes{
static HashMap<Integer,String> hm = new HashMap<Integer,String>();
static {
hm.put(-7,"tinyint"); //also for bit
hm.put(-5,"bigint");
hm.put(-4,"blob");
hm.put(-3,"tinyblob"); //also for medium blob , long blob
hm.put(-2,"geometry"); // also for point,line string,polygon multi point,multi line string,multi polygon, geometry collection , binary
hm.put(-1,"text"); //also for tinytext, medium text , long text
hm.put(1,"char");
hm.put(3,"decimal");
hm.put(4,"int"); //also for medium int
hm.put(5,"smallint");
hm.put(7,"float");
hm.put(8,"double");
hm.put(12,"varchar");
hm.put(91,"date"); //also for year
hm.put(92,"time");
hm.put(93,"datetime "); //also for current time stamp
}
public static String getType(int i){
String ii = String.valueOf(i);
return String.valueOf(hm.get(i));
}
public static String getCom(int i){
switch(i){
case -7:
return "";
case -5:
return "";
case -1:
return "'";
case 3:
return "";
case 4:
return "";
case 5:
return "";
case 7:
return "";
case 8:
return "";
case 12:
return "'";
case 91:
return "'";
case 92:
return "'";
case 93:
return "'";
default :
return "'";
}
}
}