@@ -183,17 +183,25 @@ public static String getJDBCTypeName(int value) {
183183 * @throws SQLException
184184 */
185185
186- // scale and precision have numeric column
187- public static boolean typeHasScaleAndPrecision (int sqlType ) {
188- return (sqlType == Types .DECIMAL || sqlType == Types .NUMERIC
189- || sqlType == Types .REAL || sqlType == Types .FLOAT || sqlType == Types .DOUBLE );
190- }
191-
192- // length is for string column
193- public static boolean typeHasLength (int sqlType ) {
194- return (sqlType == Types .CHAR || sqlType == Types .DATE
195- || sqlType == Types .LONGVARCHAR || sqlType == Types .TIME || sqlType == Types .TIMESTAMP
196- || sqlType == Types .VARCHAR );
197- }
198- }
186+ // scale is for non floating point numeric columns
187+ public static boolean typeHasScale (int sqlType ) {
188+ return (sqlType == Types .DECIMAL || sqlType == Types .NUMERIC );
189+ }
190+
191+ // precision is for numeric columns
192+ public static boolean typeHasPrecision (int sqlType ) {
193+ return (sqlType == Types .DECIMAL || sqlType == Types .NUMERIC
194+ || sqlType == Types .REAL || sqlType == Types .FLOAT || sqlType == Types .DOUBLE );
195+ }
199196
197+ public static boolean typeHasScaleAndPrecision (int sqlType ) {
198+ return typeHasScale (sqlType ) && typeHasPrecision (sqlType );
199+ }
200+
201+ // length is for string columns
202+ public static boolean typeHasLength (int sqlType ) {
203+ return (sqlType == Types .CHAR || sqlType == Types .DATE
204+ || sqlType == Types .LONGVARCHAR || sqlType == Types .TIME || sqlType == Types .TIMESTAMP
205+ || sqlType == Types .VARCHAR );
206+ }
207+ }
0 commit comments