Class SQLUtilities

java.lang.Object
com.softwaremining.sql.SQLUtilities

public class SQLUtilities extends Object
SQL Utlities
  • Field Details

    • totalRuntime

      public static long totalRuntime
      for internal use only ... profiling information
  • Constructor Details

    • SQLUtilities

      public SQLUtilities()
  • Method Details

    • validateParameter

      public static String validateParameter(String param)
      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

      public static String clean(byte[] bytes)
      remove the garbage characters from a field. Useful when reading material from BLOB fields etc.
      Parameters:
      bytes -
      Returns:
    • convertBlobAndClobsToBytes

      public static final byte[] convertBlobAndClobsToBytes(Object object)
      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

      public static String toString(Object value)
    • trim32

      public static char[] trim32(char[] chars)
      remove all occurances of char '32' from the end ...
      Parameters:
      chars -
      Returns: