All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.bulletproof.util.DBUtils

java.lang.Object
   |
   +----com.bulletproof.util.DBUtils

public final class DBUtils
extends Object

Variable Index

 o colorList

Constructor Index

 o DBUtils()

Method Index

 o cvtcolor(String)
Convert a string to a color.
 o floatValue(String)
Convert a String into a float
 o getDataSourceType(Jagg)
Get the type of the data source being used.
 o getFieldQuote(int, int)
Get the field quote type for this datatype and datasource
 o getPlatform()
Get the name of the platform we are running on.
 o intToString(int)
Format a numeric string value into a string.
 o ischaracter(Component, StatusMessage)
Validate that a TextComponent has an entry in it.
 o ischaracter(Component, StatusMessage, String)
Validate that a TextComponent has an entry in it.
 o isfloat(Component, StatusMessage)
Validate that a TextComponent has an float entry in it.
 o isfloat(Component, StatusMessage, String)
Validate that a TextComponent has an float entry in it.
 o isnumeric(Component, StatusMessage)
Validate that a TextComponent has an numeric entry in it.
 o isnumeric(Component, StatusMessage, String)
Validate that a TextComponent has an numeric entry in it.
 o isOdbcChar(int)
Check if this field type is an ODBC character field.
 o isOdbcDate(int)
Check if this field type is an ODBC date.
 o isvalidDate(TextField, StatusMessage)
Validate the given date.
 o isvalidDate(TextField, StatusMessage, String)
Validate the given date.
 o replace(String, String, String)
 o setSqlMessage(User, Jagg, String)
Retrieve just the SQL Message from an SQL Error.
 o sqlConvert(String, int, int)
Convert this field depending on the type and Database.
 o sqlRequiresChange(Jagg, int)
Check if specific changes need to be made to an SQL for the given datasource type.
 o str(float, int, int)
Format a numeric value into a string.
 o toInt(String)
Format a numeric string value into an int.
 o tonum(String)
Format a numeric string value into a string.

Variables

 o colorList
 public static final Color colorList[]

Constructors

 o DBUtils
 public DBUtils()

Methods

 o getFieldQuote
 public static String getFieldQuote(int fieldType,
                                    int dsnType)
Get the field quote type for this datatype and datasource

Parameters:
fieldType - the ODBC field type
dsnType - the type of datasource
 o isOdbcDate
 public static boolean isOdbcDate(int dtype)
Check if this field type is an ODBC date.

Parameters:
dtype - ODBC datatype.
Returns:
true if datatype is of the expected type.
 o isOdbcChar
 public static boolean isOdbcChar(int dtype)
Check if this field type is an ODBC character field.

Parameters:
dtype - ODBC datatype.
Returns:
true if datatype is of the expected type.
 o sqlRequiresChange
 public static boolean sqlRequiresChange(Jagg jaggSQL,
                                         int testNum)
Check if specific changes need to be made to an SQL for the given datasource type.

Parameters:
jaggSQL - the instance of JDPJagg to get the datasource type.
testNum - the number of the text to perform (presently only 0 is implemented).
Returns:
the specified datasource requires a change.
 o setSqlMessage
 public static void setSqlMessage(User user,
                                  Jagg jaggSQL,
                                  String SQL)
Retrieve just the SQL Message from an SQL Error.

Parameters:
jaggSQL - the instance of JDPJagg to get the datasource type.
SQL - the SQL that was run that caused the error.
 o ischaracter
 public boolean ischaracter(Component nval,
                            StatusMessage mainmsg)
Validate that a TextComponent has an entry in it.

Parameters:
comp - text component to validate.
mainmsg - handle to status message object for any error messages.
Returns:
true if component is not empty.
 o ischaracter
 public boolean ischaracter(Component nval,
                            StatusMessage mainmsg,
                            String message)
Validate that a TextComponent has an entry in it.

Parameters:
comp - text component to validate.
mainmsg - handle to status message object for any error messages.
message - message to display if text component is empty.
Returns:
true if component is not empty.
 o isnumeric
 public boolean isnumeric(Component nval,
                          StatusMessage mainmsg)
Validate that a TextComponent has an numeric entry in it.

Parameters:
comp - text component to validate.
mainmsg - handle to status message object for any error messages.
Returns:
true if component has a valid numeric entry.
 o isnumeric
 public boolean isnumeric(Component nval,
                          StatusMessage mainmsg,
                          String message)
Validate that a TextComponent has an numeric entry in it.

Parameters:
comp - text component to validate.
mainmsg - handle to status message object for any error messages.
message - message to display if text component is empty.
Returns:
true if component has a valid numeric entry.
 o isfloat
 public boolean isfloat(Component nval,
                        StatusMessage mainmsg)
Validate that a TextComponent has an float entry in it.

Parameters:
comp - text component to validate.
mainmsg - handle to status message object for any error messages.
Returns:
true if component has a valid numeric entry.
 o isfloat
 public boolean isfloat(Component nval,
                        StatusMessage mainmsg,
                        String message)
Validate that a TextComponent has an float entry in it.

Parameters:
comp - text component to validate.
mainmsg - handle to status message object for any error messages.
message - message to display if text component is empty.
Returns:
true if component has a valid numeric entry.
 o isvalidDate
 public static boolean isvalidDate(TextField nval,
                                   StatusMessage mainmsg)
Validate the given date.

Parameters:
nval - the TextField containing the date.
mainmsg - the handle to the status bar for error messages.
Returns:
true if the date is valid.
 o isvalidDate
 public static boolean isvalidDate(TextField dval,
                                   StatusMessage mainmsg,
                                   String message)
Validate the given date.

Parameters:
nval - the TextField containing the date.
mainmsg - the handle to the status bar for error messages.
message - the message to display if the data is not valid.
Returns:
true if the date is valid.
 o replace
 public static String replace(String dstring,
                              String searchString,
                              String replaceString)
 o tonum
 public static String tonum(String nstring)
Format a numeric string value into a string.

Parameters:
nstring - the numeric string value.
Returns:
the equivalent string value with nulls or spaces removed.
 o toInt
 public static int toInt(String nstring)
Format a numeric string value into an int.

Parameters:
nstring - the numeric string value.
Returns:
the equivalent int value.
 o intToString
 public static String intToString(int val)
Format a numeric string value into a string.

Parameters:
nstring - the numeric string value.
Returns:
the equivalent string value with nulls or spaces removed.
 o getPlatform
 public static String getPlatform()
Get the name of the platform we are running on.

Returns:
the name of the platform we are running on.
 o getDataSourceType
 public static int getDataSourceType(Jagg jaggSQL)
Get the type of the data source being used.

Parameters:
jaggSQL - the instance of JDPJagg to get the datasource type.
Returns:
the type of the datasource/database.
 o cvtcolor
 public static Color cvtcolor(String ccolor)
Convert a string to a color.

Parameters:
ccolor - the string color.
Returns:
the actual color.
 o str
 public static String str(float nval,
                          int len,
                          int dec)
Format a numeric value into a string.

Parameters:
nval - the float value to convert.
len - the number of significant digits to format to.
dec - the number of decimal places to convert to.
Returns:
the equivalent string value.
 o floatValue
 public static float floatValue(String stringFloat)
Convert a String into a float

Parameters:
stringFloat - the string to convert.
Returns:
the equivalent float value.
 o sqlConvert
 public static String sqlConvert(String sqlString,
                                 int dt,
                                 int datasourceType)
Convert this field depending on the type and Database.

Parameters:
sqlString - SQL string to convert.
datasourceType - type of database.
Returns:
converted SQL String.

All Packages  Class Hierarchy  This Package  Previous  Next  Index