Class DB_Trigger


  • public class DB_Trigger
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      DB_Trigger()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static java.lang.String createTrigger​(java.lang.String trigName, java.lang.String tableName, java.lang.String whenClause, java.sql.ResultSet aTrig)
      Generate DDL for a specific trigger.
      static void doTriggers​(java.sql.Connection conn, boolean supportsWhenClause)
      Generate the DDL for all triggers in a given database.
      • Methods inherited from class java.lang.Object

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

      • DB_Trigger

        public DB_Trigger()
    • Method Detail

      • doTriggers

        public static void doTriggers​(java.sql.Connection conn,
                                      boolean supportsWhenClause)
                               throws java.sql.SQLException
        Generate the DDL for all triggers in a given database.
        Parameters:
        conn - Connection to the source database.
        supportsWhenClause - Tells whether the database supports the trigger WHEN clause.
        Throws:
        java.sql.SQLException
      • createTrigger

        private static java.lang.String createTrigger​(java.lang.String trigName,
                                                      java.lang.String tableName,
                                                      java.lang.String whenClause,
                                                      java.sql.ResultSet aTrig)
                                               throws java.sql.SQLException
        Generate DDL for a specific trigger.
        Parameters:
        trigName - Name of the trigger.
        tableName - Name of the table on which the trigger fires.
        whenClause - The WHEN clause text (possibly null).
        aTrig - Information about the trigger.
        Returns:
        The DDL for the current trigger is returned as a String.
        Throws:
        java.sql.SQLException