X-Git-Url: http://git.phpeclipse.com diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/util/sql/TypesHelper.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/util/sql/TypesHelper.java index feed61e..b43c227 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/util/sql/TypesHelper.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/util/sql/TypesHelper.java @@ -87,4 +87,35 @@ 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 == CHAR || type == VARCHAR || type == LONGVARCHAR + || type == BINARY || type == VARBINARY || type == LONGVARBINARY + || type == CLOB || type == BLOB); + } }