com.ibm.tivoli.maximo.dbmanage.connection

Class AnalyzeSql

  • java.lang.Object
    • com.ibm.tivoli.maximo.dbmanage.connection.AnalyzeSql


  • public class AnalyzeSql
    extends java.lang.Object
    This class examines SQL statements for Multitenancy.
    See Also:
    MTConnection
    • Constructor Summary

      Constructors 
      Constructor and Description
      AnalyzeSql(java.lang.String sql)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String appendWhere(java.lang.String additionalWhere)
      Append a where clause to the SQL statement.
      java.lang.String getTargetTable()
      What is the target table of the insert/update/delete.
      java.lang.String getUpdateWhere()
      Get the where clause from the update SQL statement, if any.
      boolean isInsert()
      Is this an insert statement?
      boolean isUpdate()
      Is this SQL an update statement?
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AnalyzeSql

        public AnalyzeSql(java.lang.String sql)
        Constructor
        Parameters:
        sql - The SQL statement to analyze.
    • Method Detail

      • getTargetTable

        public java.lang.String getTargetTable()
        What is the target table of the insert/update/delete.
        Returns:
        The target table if the operation is recognized, or null.
      • isInsert

        public boolean isInsert()
        Is this an insert statement?
      • appendWhere

        public java.lang.String appendWhere(java.lang.String additionalWhere)
        Append a where clause to the SQL statement. The additional where clause will be added with a "where" or "and" depending on whether there already is a where clause. Not for insert statements.
        Parameters:
        additionalWhere - The where clause to append.
        Returns:
        The SQL statement with the where clause appended.
      • isUpdate

        public boolean isUpdate()
        Is this SQL an update statement?
      • getUpdateWhere

        public java.lang.String getUpdateWhere()
        Get the where clause from the update SQL statement, if any.
        Returns:
        The where clause, starting after the "where". For example: "c = 1". Returns null if there's no where clause.