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
-
colorList
-
-
DBUtils()
-
-
cvtcolor(String)
- Convert a string to a color.
-
floatValue(String)
- Convert a String into a float
-
getDataSourceType(Jagg)
- Get the type of the data source being used.
-
getFieldQuote(int, int)
- Get the field quote type for this datatype and datasource
-
getPlatform()
- Get the name of the platform we are running on.
-
intToString(int)
- Format a numeric string value into a string.
-
ischaracter(Component, StatusMessage)
- Validate that a TextComponent has an entry in it.
-
ischaracter(Component, StatusMessage, String)
- Validate that a TextComponent has an entry in it.
-
isfloat(Component, StatusMessage)
- Validate that a TextComponent has an float entry in it.
-
isfloat(Component, StatusMessage, String)
- Validate that a TextComponent has an float entry in it.
-
isnumeric(Component, StatusMessage)
- Validate that a TextComponent has an numeric entry in it.
-
isnumeric(Component, StatusMessage, String)
- Validate that a TextComponent has an numeric entry in it.
-
isOdbcChar(int)
- Check if this field type is an ODBC character field.
-
isOdbcDate(int)
- Check if this field type is an ODBC date.
-
isvalidDate(TextField, StatusMessage)
- Validate the given date.
-
isvalidDate(TextField, StatusMessage, String)
- Validate the given date.
-
replace(String, String, String)
-
-
setSqlMessage(User, Jagg, String)
- Retrieve just the SQL Message from an SQL Error.
-
sqlConvert(String, int, int)
- Convert this field depending on the type and Database.
-
sqlRequiresChange(Jagg, int)
- Check if specific changes need to be made to an SQL
for the given datasource type.
-
str(float, int, int)
- Format a numeric value into a string.
-
toInt(String)
- Format a numeric string value into an int.
-
tonum(String)
- Format a numeric string value into a string.
colorList
public static final Color colorList[]
DBUtils
public DBUtils()
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
replace
public static String replace(String dstring,
String searchString,
String replaceString)
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.
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.
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.
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.
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.
cvtcolor
public static Color cvtcolor(String ccolor)
- Convert a string to a color.
- Parameters:
- ccolor - the string color.
- Returns:
- the actual color.
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.
floatValue
public static float floatValue(String stringFloat)
- Convert a String into a float
- Parameters:
- stringFloat - the string to convert.
- Returns:
- the equivalent float value.
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