psdi.configure

Class TextSearch

  • java.lang.Object
    • psdi.configure.TextSearch
  • All Implemented Interfaces:
    ScriptApp, UpgConstants


    public class TextSearch
    extends java.lang.Object
    implements UpgConstants, ScriptApp
    This class provides methods to stop and start text search jobs. It can also be used for adjusting text search on a table (i.e., on all columns needing adjustment). Also see Util for sql statements to implement text search on a table or column.
    • Field Detail

      • con

        protected java.sql.Connection con
        The database connection.
      • util

        protected Util util
        Reference to the Util class.
      • dbIn

        protected int dbIn
        The database platform we are connected to. Valid values are specified in UpgConstants.
      • sYes

        protected java.lang.String sYes
        The value indicating Yes for YORN attributes.
      • sNo

        protected java.lang.String sNo
        The value indicating No for YORN attributes.
      • owner

        protected java.lang.Object owner
        Should be an instance of CommonShell or UpdateDB.
      • db2TextOut

        protected java.io.PrintStream db2TextOut
        The print stream for "db2ts" commands. Usually this will be null, and db2ts commands will be executed immediately via runtime. If this is not null, then any db2ts commands will be sent to the print stream. Regular sql statements will still be executed immediately, as usual. This is set by utilities such as Maxinst and ConfigDB that are run on a machine different from the machine where the database is installed.
      • db2TextOut2

        protected java.io.PrintStream db2TextOut2
        Second print stream for "db2ts" commands. This is used when db2TextOut has already been defined and output has to go to two different streams.
    • Constructor Detail

      • TextSearch

        public TextSearch(Util util,
                          java.sql.Connection con,
                          java.lang.Object owner)
        Constructor
        Parameters:
        util -
        con -
        owner - The class that is constructing TextSearch. This should be an instance of CommonShell or UpdateDB.
        Throws:
        java.lang.Exception
    • Method Detail

      • isTextSearchingEnabled

        public boolean isTextSearchingEnabled()
                                       throws java.lang.Exception
        Is there an active text searching process?
        Throws:
        java.lang.Exception
      • setDB2PrintStream

        public void setDB2PrintStream(java.io.PrintStream db2Out,
                                      java.io.PrintStream db2Out2)
        Set value for db2TextOut and (optionally) db2TextOut2. If this is not called then these both default to null and db2text statements are executed immediately rather than output to a stream.
        Parameters:
        db2Out - Print Stream for db2text commands. Usually this method is not called. See javadocs for db2TextOut.
        db2Out2 - Second Print Stream for db2text commands, when output needs to go to two different streams. If output needs to go to only one stream, then db2Out will be non-null and db2Out2 will be null.
      • stopTextSearchJobs

        public void stopTextSearchJobs(boolean dropProcedures,
                                       boolean doWait)
                                throws java.lang.Exception
        Stop text search jobs.
        Parameters:
        dropProcedures - If true, this method also attempts to drop the maximo text search procedures.
        doWait - If true, then if the first try at stopping the jobs is not successful, the method will continue trying for 2 minutes before giving up.
        Throws:
        java.lang.Exception
      • doWait

        public void doWait(java.lang.Integer milli)
                    throws java.lang.Exception
        Wait the specified number of milliseconds.
        Parameters:
        milli -
        Throws:
        java.lang.Exception
      • getNumberOfCollections

        public int getNumberOfCollections()
                                   throws java.lang.Exception
        Return the number of collections - DB2 specific method.
        Returns:
        The number of collections.
        Throws:
        java.lang.Exception
      • startTextSearchJobs

        public void startTextSearchJobs()
                                 throws java.lang.Exception
        Start text search jobs from scratch. Creates/replaces procedures and then calls them.
        Throws:
        java.lang.Exception
      • restartTextJobs

        public void restartTextJobs()
                             throws java.lang.Exception
        Restart Oracle Text jobs. Looks for procedures/jobs and if found, calls/enables them.
        Throws:
        java.lang.Exception
      • getRichTextCreateIndexStatement

        public static java.lang.String getRichTextCreateIndexStatement(java.sql.Connection con,
                                                                       java.lang.String ixname,
                                                                       java.lang.String tbname,
                                                                       java.lang.String colName,
                                                                       boolean multilang,
                                                                       java.lang.String langColumnName,
                                                                       java.lang.String storageClause)
                                                                throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • getRichTextCreateIndexStatement

        public static java.lang.String getRichTextCreateIndexStatement(java.sql.Connection con,
                                                                       int dbOut,
                                                                       java.lang.String ixname,
                                                                       java.lang.String tbname,
                                                                       java.lang.String colName,
                                                                       boolean multilang,
                                                                       java.lang.String langColumnName,
                                                                       java.lang.String storageClause)
                                                                throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • getRichTextCreateIndexStatement

        public static java.lang.String getRichTextCreateIndexStatement(java.sql.Connection con,
                                                                       ServerType server,
                                                                       java.lang.String ixname,
                                                                       java.lang.String tbname,
                                                                       java.lang.String colName,
                                                                       boolean multilang,
                                                                       java.lang.String langColumnName,
                                                                       java.lang.String storageClause)
                                                                throws java.sql.SQLException
        Throws:
        java.sql.SQLException