Package com.softwaremining.sql
Class SQLUtilities
java.lang.Object
com.softwaremining.sql.SQLUtilities
SQL Utlities
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
clean
(byte[] bytes) remove the garbage characters from a field.static final byte[]
convertBlobAndClobsToBytes
(Object object) DB2 support method - in DB2 CBLOBS/BLOBS return java.sql.CLOB or java.sql.Blob.static final void
readSQLField
(ResultSet resultSet, ISMObject field, int[] indexes, int columnNumber) method provided purely for sake of reading ORACLE CLOBS.static String
static char[]
trim32
(char[] chars) remove all occurances of char '32' from the end ...static String
validateParameter
(String param) In an SQL Statement when we have "where STRING-1 > ?" The parameter is typically all spaces.
-
Field Details
-
totalRuntime
public static long totalRuntimefor internal use only ... profiling information
-
-
Constructor Details
-
SQLUtilities
public SQLUtilities()
-
-
Method Details
-
validateParameter
In an SQL Statement when we have "where STRING-1 > ?" The parameter is typically all spaces. But Fujitsu cobol uses '?' for blank lines. This causes a problem for where conditions - ie- Parameters:
param
-- Returns:
-
clean
remove the garbage characters from a field. Useful when reading material from BLOB fields etc.- Parameters:
bytes
-- Returns:
-
convertBlobAndClobsToBytes
DB2 support method - in DB2 CBLOBS/BLOBS return java.sql.CLOB or java.sql.Blob. This method will converts them into bytes[]- Parameters:
object
-- Returns:
- java.sql.CLOB or java.sql.Blob
-
readSQLField
public static final void readSQLField(ResultSet resultSet, ISMObject field, int[] indexes, int columnNumber) throws SQLException method provided purely for sake of reading ORACLE CLOBS. WHen field is ORACLE clob - it is better to read it using getString instead of getObject- Throws:
SQLException
-
toString
-
trim32
public static char[] trim32(char[] chars) remove all occurances of char '32' from the end ...- Parameters:
chars
-- Returns:
-