Class OdbcUtils


  • public class OdbcUtils
    extends Object
    Various ODBC utility methods.
    • Method Detail

      • addQuotationMarksIfNeeded

        public static String addQuotationMarksIfNeeded​(String str)
        Add quotation marks at the beginning and end of the string.
        Parameters:
        str - Input string.
        Returns:
        String surrounded with quotation marks.
      • removeQuotationMarksIfNeeded

        public static String removeQuotationMarksIfNeeded​(String str)
        Remove quotation marks at the beginning and end of the string if present.
        Parameters:
        str - Input string.
        Returns:
        String without leading and trailing quotation marks.
      • preprocessPattern

        public static String preprocessPattern​(String ptrn)
        Pre-process table or column pattern.
        Parameters:
        ptrn - Pattern to pre-process.
        Returns:
        Processed pattern.
      • prepareSchema

        public static String prepareSchema​(String schema)
        Prepare client's schema for processing.
        Parameters:
        schema - Schema.
        Returns:
        Prepared schema.
      • getIgniteTypeFromOdbcType

        public static String getIgniteTypeFromOdbcType​(String odbcDataType)
        Lookup Ignite data type corresponding to specific ODBC data type
        Parameters:
        odbcDataType - ODBC data type identifier
        Returns:
        Ignite data type name
      • tryRetrieveH2ErrorMessage

        public static String tryRetrieveH2ErrorMessage​(Throwable err)
        Tries to retrieve H2 engine error message from exception. If the exception is not of type "org.h2.jdbc.JdbcSQLException" returns original error message.
        Parameters:
        err - Exception.
        Returns:
        Error message.
      • rowsAffected

        public static long rowsAffected​(QueryCursor<List<?>> qryCur)
        Get affected rows for statement.
        Parameters:
        qryCur - Cursor.
        Returns:
        Number of table rows affected, if the query is DML, and -1 otherwise.