Maximo Perform query operations

Source: Internet
Author: User

In Maximo sometimes we need to query according to some MBO properties, for example, according to the status and Reportdate properties, this can be achieved by Mbosetremote Setwhere method. The following code shows how to query the results based on status and Reportdate. This is because the Oracle database is used in the background, so Oracle's date function is used.

Import Psdi.mbo.MboRemote;
Import Psdi.mbo.MboSetRemote;
Import psdi.util.MXException;
Import psdi.util.MXSession;
Import java.rmi.RemoteException; 
        public class Testquery {public static void main (string[] args) throws Exception {mxsession mxsession = null;
            try {mxsession = Getmxsession ();
            Mbosetremote mbosetremote = (mbosetremote) mxsession.getmboset ("WorkOrder"); Mbosetremote.setwhere (status = ' close ') and (Reportdate between to_date (' 1999-01-01 ', ' yyyy-mm-dd ') and To_date ('
            2014-01-01 ', ' yyyy-mm-dd '));
            Mbosetremote.setqbeexactmatch (TRUE);
            int idx = 0;
            Mboremote mboremote = Mbosetremote.movefirst ();
                while (true) {if (Mboremote = null | | | idx >=) {break; } System.out.println (Mboremote.getstring ("wonum") + ":" + mboremote.getmbovaluedata ("Reportdate"). GetData
                Asdate ()); Mboremote= Mbosetremote.movenext ();
        } catch (Exception ex) {ex.printstacktrace ();
        finally {closemxsession (mxsession); } public static Mxsession Getmxsession () throws RemoteException, mxexception {String Server = " 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.