KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > webdocwf > util > loader > CheckType


1 /*
2   Loader - tool for transfering data from one JDBC source to another and
3   doing transformations during copy.
4     Copyright (C) 2002-2003 Together
5     This library is free software; you can redistribute it and/or
6     modify it under the terms of the GNU Lesser General Public
7     License as published by the Free Software Foundation; either
8     version 2.1 of the License, or (at your option) any later version.
9     This library is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12     Lesser General Public License for more details.
13     You should have received a copy of the GNU Lesser General Public
14     License along with this library; if not, write to the Free Software
15     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  Loader.java
17  Date: 03.03.2003.
18  @version 2.1 alpha
19  @authors:
20  Radoslav Dutina rale@prozone.co.yu
21  */

22
23
24 package org.webdocwf.util.loader;
25
26 import java.util.Hashtable JavaDoc;;
27 /**
28  *
29  * CheckType class is used for checking the type of data
30  * @author Radoslav Dutina
31  * @version 1.0
32  */

33 public class CheckType {
34
35 // private static final String[] binaryTypes = {
36
// "blob", "clob", "image", "varbinary", "longvarbinary",
37
// "binary", "bytea"};
38
//ZK comment this 6.5 2004
39
// private static final String[] intTypes = {"decimal", "int", "numeric", "real",
40
// "short", "long", "float", "double", "bigint", "money",
41
// "smallmoney", "smallint",
42
// "number"};
43
//
44
// private static final String[] decimalTypes = {"decimal", "bigdecimal"};
45
//"number" for oracle is also decimal Type
46
//
47
// private static final String[] doubleTypes = {"float", "double"};
48
//
49
//ZK added this 6.5 2004
50
// private static ConfigReader confReader;
51
//end
52
/**
53    * Empty Check class constructor
54    */

55   public CheckType() {
56   }
57
58 // /**
59
// * Method isBinaryObject is used for checking column type
60
// * @param s string that represents column type
61
// * @return true if it is binary object and false if it is not
62
// */
63
// public static boolean isBinaryObject(String s) {
64
// boolean type = false;
65
// for (int i = 0; i < binaryTypes.length; i++) {
66
// if (binaryTypes[i].equalsIgnoreCase(s)) {
67
// type = true;
68
// break;
69
// }
70
// }
71
// return type;
72
// }
73
//ZK comment this 6.5 2004
74
// /**
75
// * Method isNumber is used for checking column type.
76
// * @param s String that represents column type.
77
// * @return true if it is numeric and false if it is not.
78
// */
79
// public static boolean isNumber(String s) {
80
// boolean type = false;
81
// for (int i = 0; i < intTypes.length; i++) {
82
// if (intTypes[i].equalsIgnoreCase(s)) {
83
// type = true;
84
// break;
85
// }
86
// }
87
//
88
// return type;
89
// }
90
//ZK added this 6.5.2004
91
// /**
92
// * Method isNumber is used for checking column type.
93
// * @param s String that represents column type.
94
// * @return true if it is numeric and false if it is not.
95
// */
96
// public static boolean isNumber(String s) {
97
// boolean isNumber = false;
98
// boolean containsKey = hash.containsKey((s).toUpperCase());
99
// String value = hash.get((s).toUpperCase()).toString();
100
// if ((containsKey) && (value.equalsIgnoreCase("true"))){
101
// return (new Boolean(value).booleanValue());
102
// }else{
103
// return isNumber;
104
// }
105
//
106
// }
107
//
108
// /**
109
// * Method isDecimal is used for checking column type.
110
// * @param s String that represents column type.
111
// * @return true if it is numeric and false if it is not.
112
// */
113
// public static boolean isDecimal(String s) {
114
// boolean type = false;
115
// for (int i = 0; i < decimalTypes.length; i++) {
116
// if (decimalTypes[i].equalsIgnoreCase(s)) {
117
// type = true;
118
// break;
119
// }
120
// }
121
// return type;
122
// }
123
//
124
// /**
125
// * Method isDouble is used for checking column type.
126
// * @param s String that represents column type.
127
// * @return true if it is numeric and false if it is not.
128
// */
129
// public static boolean isDouble(String s) {
130
// boolean type = false;
131
// for (int i = 0; i < doubleTypes.length; i++) {
132
// if (doubleTypes[i].equalsIgnoreCase(s)) {
133
// type = true;
134
// break;
135
// }
136
// }
137
// return type;
138
// }
139

140 }
141
Popular Tags