Quantum version 2.4.1
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.quantum.sql / src / com / quantum / util / sql / TypesHelper.java
index feed61e..2b39182 100644 (file)
@@ -87,4 +87,34 @@ public class TypesHelper {
                return name;
        }
 
+       /**
+        * True if the type is Real (numeric and with decimal part) according to java.sql.Types
+        * @param type
+        * @return
+        */
+       public static boolean isReal(int type) {
+               return (type == DECIMAL || type == DOUBLE || type == FLOAT || 
+                       type == NUMERIC || type == REAL );
+       }
+
+       /**
+        * True if the type is Numeric according to java.sql.Types
+        * @param type
+        * @return
+        */
+       public static boolean isNumeric(int type) {
+               return (type == DECIMAL || type == DOUBLE || type ==FLOAT || 
+                       type == NUMERIC || type == REAL || type == BIGINT ||
+                       type == TINYINT || type == SMALLINT || type == INTEGER );
+       }
+
+       /**
+        * True if the type is textual according to java.sql.Types
+        * @param type
+        * @return
+        */
+       public static boolean isText(int type) {
+               return (type == CLOB || type == VARBINARY || type ==VARCHAR
+                               || type == CHAR || type == LONGVARCHAR );
+       }
 }