need help in writing a little java code

Hello
I have a small requirement where I need to write a java code small. I am using table. Please suggest if you know the solution:

1. the need to compare the id of user connection is preset in the table of correspondence or not.
2. If the id of the current user in the search then send, type 'A' mail
3. If the user id in not present in the search then send by email 'B' type.

Please suggest.


Thank you
Kalpana.

Use this code. You must pass the name userlogin and research

Public String returned (String UserLogin, String lookupcode)
{
The chain e-mail;
try {}
tcLookupOperationIntf lookupIntf = (tcLookupOperationIntf.class) Platform.getService;
HashMap lookupValues = getLookupHashMap (lookupIntf, lookupCode);
Found string = lookupValues.get (UserLogin);
If (found! = null) email = ' EMAIL ';
on the other
email = 'EMAIL B ';.
} catch (Exception e) {}
return of electronic mail;
}

private HashMap getLookupHashMap (tcLookupOperationsIntf lookupOperationsIntf, String lookupCode) survey tcAPIException, tcInvalidLookupException, tcColumnNotFoundException {}
HashMap lookupMap = new HashMap ();

tcResultSet resultLookupHashMap = lookupOperationsIntf
.getLookupValues (lookupCode);
int countResultLookupHashMap = resultLookupHashMap.getRowCount ();
If (countResultLookupHashMap > 0) {}
for (int i = 0; i)< countresultlookuphashmap;="" i++)="">
resultLookupHashMap.goToRow (i);
lookupMap.put (resultLookupHashMap.. getStringValue ("Definition.Lookup Code Information.Code search key")
resultLookupHashMap.getStringValue ("search Definition.Lookup Code Information.Decode"));
}}
Return lookupMap;
}

Tags: Fusion Middleware

Similar Questions

  • Need help finding a MBean via Java code

    I'm reading the bea.jrockit.management:type mbean = Memory, but nothing I've tried works. Y at - it a special to access this value tip (I'm trying to find the physical RAM installed on the hardware)? I see him just day to Mission control, but I can't get the code to work.

    I tried
     
    env.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES, "weblogic.management.remote");
    env.put("jmx.remote.x.request.waiting.timeout", new Long(10000));
    
    serviceURL = new JMXServiceURL("t3", serverName, port, "/jndi/" + "weblogic.management.mbeanservers.domainruntime");
    connector = JMXConnectorFactory.connect(serviceURL, env);
    connection = connector.getMBeanServerConnection();
    result = connection.getAttribute(new ObjectName("bea.jrockit.management:Location=" + System.getProperty("weblogic.Name") + ",type=Memory"), "TotalPhysicalMemory");
    and...
    serviceURL2 = new JMXServiceURL("t3", serverName, port, "/jndi/" + "weblogic.management.mbeanservers.runtime");
    connector2 = JMXConnectorFactory.connect(serviceURL2, env);
    connection2 = connector2.getMBeanServerConnection();
    result = connection2.getAttribute(new ObjectName("bea.jrockit.management:type=Memory"), "TotalPhysicalMemory");
    The first method works for the "java.lang:Location = myLocation, type = OperatingSystem"), "TotalPhysicalMemorySize", but this value does not correspond to the actual amount of physical memory (shows 4 GB for me instead of 8 GB).

    Thank you.
    -Bill

    Hi Bill,

    You must register to the JRockitConsoleBean before you can programmatically access the MBeans. This is what happens when you run the Mission control.

    R28 the MBean is called oracle.jrockit.management:type = JRockitConsole and for R27 is bea.jrockit.management:type = JRockitConsole.

    For example

    Connection2.getMBeanInfo (new ObjectName("bea.jrockit.management:type=JRockitConsole"));)
    result = connection2.getAttribute (new ObjectName ("bea.jrockit.management:type = Memory"), "TotalPhysicalMemory);

    Best regards
    Erik

  • I need help to update my computer (error code: 80070424)

    original title: I need help to update my computer

    I could not update my computer for more than a year. I searched for the cause of this and have been unsuccessful. Whenever I click search for updates, it gives me errors, and then I click on get help with errors and tried troubleshooting but have not been able to solve my problem. Lately, he has been interfering with the update or install new programs. Now I can't update my Itunes or Ipod. I can't upgrade to Windows 7. I can ' t use microsft word because everytime I try to install or update these things, it won't let me. I've been putting off not to worry so much about the updates, but they have reached a limit, when my computer became difficult to use. The error code is 80070424.

    Restore the system to factory settings.  Install applications from their media keys/serial numbers and product, that you put aside.  Restore your data from backup.

  • need help with windows update C8000F1A error code

    I need help with an error code that is given to my PC when I try to put up-to-date

    Hello

    1. don't you make recent changes?

    2. This does happen with any special updates or all updates?

    I suggest you to follow these steps and check if that helps:

    Method 1:

    If you have installed a security software on the computer, then I suggest you try to disable temporary and check to see if the same problem happens. Make sure that you enable security software back once the diagnosis is made to prevent the computer from virus attacks.
    http://Windows.Microsoft.com/en-us/Windows-Vista/disable-antivirus-software

    Method 2:
    I suggest you follow the steps in the link below and check if it helps:
    http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-problems-with-installing-updates

    It will be useful.

  • help in writing a little code pl/sql

    Hi all
    I want to write a script for example I 3 Colum let A, B, C documents are already in the database now, I want my script to check the values of Colum C must equal (A, B) as A - B = C if she even noting do with C another thing she updates C with the value of A - B please help

    then you can make a little change with the rest of the code above.

    create or replace procedure test asbegin for m in (select * from t) loop  if m.C=m.A and m.C=m.B then   null;  else   update t set C=m.A-m.B where id=m.id;  end if; end loop;end;
    

    Khurram

  • Need help with the coding of java base

    Hi I am new to java, please help me!

    Here the topic requires:

    circle2S.png

    • display the result of c1.contain (3.3)
    • C1. Contains (new Circle2D (4, 5, 8.5))
    • C1. Overlaps (new Circle2D (3, 5, 0.3))

    Here's my question:

    the circle contains must have (x, y, and radius)

    Why the contain (3.3) still work when there is no RADIUS?

    My code is correct?

    It's my circle2D code:

    public class Circle2D {}

    The center of the circle

    Private double x;

    Private double y;

    The RADIUS

    RADIUS double private;

    Constructor without parameters

    public Circle2D() {}

    This (0, 0, 3);

    }

    Constructor with x, y, and radius

    public Circle2D (double x, double y, double radius) {}

    This.x = x;

    This.y = y;

    This.RADIUS = RADIUS;

    }

    Get the zone method

    {} public double getArea()

    Return Math.PI * RADIUS * RADIUS;

    }

    Get the perimeter

    {} public double getPerimeter()

    return 2 * Math.PI * RADIUS;

    }

    Check if the point (X, Y) is in the circle

    public boolean contains (double X, double Y) {}

    If (Math.sqrt ((x-X) * (x - X) + (y - Y) * (y - Y)) < radius) {}

    Returns true;

    } else {}

    Returns false;

    }

    }

    Check if the new circle is the circle

    public boolean contains {(Circle2D circle)

    If (Math.sqrt ((x-circle.x) * (x - circle.x) + (y - circle.y) * (y - circle.y)) + circle.radius < radius) {}

    Returns true;

    } else {}

    Returns false;

    }

    }

    Check if the new circle overlaps the circle

    public boolean overlaps (circle Circle2D) {}

    If (Math.sqrt ((x-circle.x) * (x - circle.x) + (y - circle.y) * (y - circle.y)) + circle.radius > RADIUS)

    (& & Math.sqrt ((x-circle.x) * (x - circle.x) + (y - circle.y) * (y - circle.y)) + circle.radius < RADIUS + circle.radius) {}

    Returns true;

    } else {}

    Returns false;

    }

    }

    public static main (String [] args) {} Sub

    Circle2D c1 = new Circle2D (2, 2, 5.5);

    System.out.println (C1. Contains (3.3));

    }

    }

    I think you're confused by the abstraction.

    C1 is a Circle, a figure of dimension 2 covering an area. That's why he needs a RADIUS.

    The contains(x,y) of the method in the class circle valid a Point which is a figure without any Dimension. That is why the method does not have a RADIUS.

    Good bye

    DPT

  • [Need help] Command execution error: null java.lang.ClassCastException - HQAPI

    Hello

    I need your support on the following error, I got from hqapi when I try to «./hqapi.sh alertdefinition sync. My order is:

    # cat ad10100.xml

    <? XML version = "1.0" encoding = "UTF-8" standalone = "yes"? >
    < AlertDefinitionResponse >
    Success of < status > < / status >
    < AlertDefinition mtime = ctime "1331204852666" = "1331204068642" id = "10100" name = "Fs [/] ok" description = "Filesystem sotto soglia critica" priority = "2" enabled = "true" active = "true" frequency = "0" count = "0" range = "0" willRecover = "false" notifyFiltered = "false" controlFiltered = "false" >
    < resource id = "10910" name = "/ dev/map/VolGroup00-LogVol00 of HR-client Linux file system mounted on / (local/ext3)" / >
    < AlertCondition required = "true" type = "1" thresholdValue = "50.0" thresholdComparator = "" & lt; "thresholdMetric ="Use %"/ >"
    < AlertAction id = "10101" className="org.hyperic.hq.measurement.action.MetricAlertAction"/ >
    < / AlertDefinition >
    < / AlertDefinitionResponse >

    # cat ad10100.xml | SH hqapi.sh alertdefinition sync

    Command execution error: null
    java.lang.ClassCastException
    at java.lang.Class.cast(Class.java:2990)
    at org.hyperic.hq.hqapi1.XmlUtil.deserialize(XmlUtil.java:64)
    at org.hyperic.hq.hqapi1.tools.AlertDefinitionCommand.sync(AlertDefinitionCommand.java:439)
    at org.hyperic.hq.hqapi1.tools.AlertDefinitionCommand.handleCommand(AlertDefinitionCommand.java:152)
    at org.hyperic.hq.hqapi1.tools.Shell.dispatchCommand(Shell.java:245)
    at org.hyperic.hq.hqapi1.tools.Shell.main(Shell.java:260)

    I have tested the following workaround but unsuccessfully:

    -try d'utiliser./hqapi.sh instead hqapi.sh sh

    -try to use different java bin (mine is/usr/java/default jdk6_u31), I tried /opt/hyperic/server-4.5.3/jre/bin/

    -Try sh hqapi.sh alertdefinition sync - file = ad10100.xml

    -try to change the XML, removal of State <>success < / status >

    HQAPI version: hqapi1-client - 4.3.0

    Hyperic HQ version: 4.5.3 - GA

    I need to synchronize alertdefinitions based on XML files please help me around this error.

    Thank you very much.

    Claudio

    Trying some updates for automatic alert via the script API definition, I met this problem as well. No matter what I did, it seemed that this class cast exception would be thrown. I downloaded the Github source HQAPI and started searching. I found that the error was in the call to the XmlUtils.deserialize method, which has invoked a JAXBContext to select the class of the object to return, after analysis of the XML. The code that calls the method waits get an object that can be cast to the type AlertDefinitionsResponse, but he returned to an object that must be cast to type AlertDefinitionResponse.

    After a bit of investigation, I realized that JAXB is the context of the node root XML data. Because the root node is AlertDefinitionResponse, he always returned an object of this type, instead of the expected AlertDefinitionsResponse type. Currently, the only way I found to get around this problem is to change the node root to AlertDefinitionsResponse. So, sync-able XML would look like the following, based on XML of the original poster.



         Success
        
            

            
            
        

    I raise a question on the Github repository so that officials are aware of this problem.

    EDIT: The problem has been discussed here

  • Need help in writing the SQL CASE or DECODE statement

    Hi experts,

    I need to write a SQL select order_num, cntry_cde, prod_id and Qty by joining order_num on PROD_ORDER and PROD_ORDER_TXT.

    Here is my sample data

    PROD ORDER_
    order_num Prod_id Qty cntry_cde
    100 US A1 5
    101 US 10 A2
    102 IN A3 4
    103 TO THE A4 9
    104. IN A5 3

    PROD ORDER_TXT_
    cntry_cde Prod_id order_num
    100 US A1
    101 US A2
    102 NZ A3
    103 TO THE A4
    A5 104

    Here's the requirement,

    (1) if the cntry_cde in PROD_ORDER is the same as cntry_cde in PROD_ORDER_TXT then select PROD_ORDER.cntry_cde (orders 100, 101, 103)
    (2) if they are different, choose PROD_ORDER_TXT (order 102, to THE NZ <>) country code
    (3) if they are different and PROD_ORDER_TXT.cntry_cde is null, I can't use it like cntry_cde in my report (order 104). It happenend just because of bad data to the source.
    I can't avoid it. Then just use the cntry_cde of PROD_ORDER

    Expected results
    100 US A1 5
    101 US 10 A2
    102 NZ A3 4 - changed in NZ
    103 TO THE A4 9
    104. IN A5 3 - IN retained as PROD_ORDER_TXT.cntry_cde is null


    instructions for creation and insertion of sample table are lower than

    create the table prod_order
    (number of order_num,
    cntry_cde CHAR (2),
    prod_id VARCHAR2 (6).
    number of quantity)

    create the table prod_order_txt
    (number of order_num,
    cntry_cde CHAR (2),
    prod_id VARCHAR2 (6))

    insert into prod_order values (100, 'WE', 'A1', 5);
    insert into prod_order values (101, 'WE', 'A2', 1);
    insert into prod_order values (102, ' to THE ', 'A3', 4);
    insert into prod_order values (103, ' to THE ', 'A4', 9);
    insert into prod_order values (104, 'IN', 'A5', 3);



    insert into prod_order_txt values (100, 'WE', 'A1');
    insert into prod_order_txt values (101, 'WE', 'A2');
    insert into prod_order_txt values (102, 'NZ', 'A3');
    insert into prod_order_txt values (103, ' to THE ', 'A4');
    insert into prod_order_txt values (104, 'A5', NULL);

    commit;

    Thank you for your help in advance

    Published by: manon March 28, 2012 13:39
  • Need help to use InputStream on my code

    Hello world

    I'm working on JDev11g U2 with ADFRC

    I use af:inputFile to download read my file. to do this, I'm getting my InputStream files on af valueChangeListener: inputFile.

    Now for the first time when I click on a button to read the content of this IS then it works fine. I press the same button again without changing my af file: InputFile, I'm getting InputStream as null, coz it closes to the EOF.

    Now the problem is I cannot reopen, cannot make a clone or can not use (int) mark with this...

    So I used a method of apache POI POIFSFileSystem.createNonClosingInputStream (InputStream is) wrapper to wrap my IS.

    According to them, it should really solve my problem, but it does not work...
    InputStream wrappedStream = POIFSFileSystem.createNonClosingInputStream(is); <-------- IS read here
    HSSFWorkbook wb = new HSSFWorkbook(wrappedStream);
    is.reset(); <-------- getting null here as i already read above
    doSomethingElse(is);
    now, tell me how can I implement this code too. Once I read my IS, it evaluates to null. so, how I reset it.

    Second way I did that convert my IS as a String so that I can wear for any number. usage. Coz, I use my IS to convert my file to XML, CSV, XLS to XML

    by using this method:
        public static String convertInputStreamToString(InputStream is) throws Exception {
            BufferedReader reader = new BufferedReader(new InputStreamReader(is));
            StringBuilder sb = new StringBuilder();
            String line = null;
            while ((line = reader.readLine()) != null) {
                sb.append(line + "\n");
            }
            is.close();
            return sb.toString();
        }
    so in the case of CSV and XML, it's way to work, but in the case of XLS, I do not hear from the converted string.

    I use this method to retrieve my IS of the String-
    for XML - 
                InputStream useIS =
                            new ByteArrayInputStream(inputStream.getBytes("UTF-8"));
    
    for CSV - (inputStream is String of my IS)
                BufferedReader csvReader;
                csvReader = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(inputStream.getBytes("UTF-8"))));
    
    for XLS - 
                POIFSFileSystem myFileSystem =
                    new POIFSFileSystem(new ByteArrayInputStream(inputStream.getBytes("UTF-8")));
                //InputStream inStr = new ByteArrayInputStream(inputStream.getBytes("UTF-8"));
                HSSFWorkbook workbook = new HSSFWorkbook(myFileSystem);
    Can now someone help me to find the right way to use my IS again and again.

    Thank you
    FIZZZ...

    OK, the problem is that you cannot reset the stream. So when the POI class does not help, you're out of luck.
    I don't get you second statement that you are not allowed to create temporary files. It is a normal procedure. Think of a file with a size of > 100Meg. This file can be processed in memory. The only chance you have is to put in a temporary file and use it.
    If you use File.createTempFile (...) the file is created in the tmp folder. Delete it after that you don't need any longer.

    Another way to handle this is to put the file intpo a blob in the comic book and read from there. It is more work for you to do, but he does not object in the file system.

    Timo

  • Need help with writing a query

    Hi all

    Can someone help please write a query for the following scenario

    Data in the table are in the format below

    student_nameSub1sub1_marksSub2sub2_marksSUB3sub3_marks
    JohnMath90Science80lang85

    Need to write a query to get it as

    student_nameObjectbrands of
    JohnMath90
    JohnScience80
    Johnlang85


    Thank you

    I'm looking so unpivoting the mulitple columns option is there. how it will be used

    I certainly learned something new today.

    create table student_marks(
      student_name varchar2(20),
      sub1 varchar2(20),
      sub1_marks number,
      sub2 varchar2(20),
      sub2_marks number,
      sub3 varchar2(20),
      sub3_marks number
    )
    ;
    insert into student_marks values(
      'john',
      'math',
      90,
      'science',
      80,
      'lang',
      85
    )
    ;
    select
      student_name, sub subject, marks
    from student_marks
    unpivot include nulls (
      (sub, marks)
      for subject in (
        (sub1, sub1_marks),
        (sub2, sub2_marks),
        (sub3, sub3_marks)
        )
    )
    ;
    drop table student_marks purge
    ;
    
    table STUDENT_MARKS created.
    1 rows inserted.
    STUDENT_NAME         SUBJECT                   MARKS
    -------------------- -------------------- ----------
    john                 math                         90
    john                 science                      80
    john                 lang                         85 
    
    table STUDENT_MARKS dropped.
    
  • Need help add captcha on my form code.

    Hi guys,.

    I need assistance with a captcha code in my form.

    I tried to read through recaptcha tutorials etc. but I don't know where to go with it.

    Here is the code for my form;

    < form method = "POST" name = 'contact form' action = "contact-form - handler.php" >

    < p >

    < label for = "name" > your name: < / label > < br >

    < input type = "text" name = "name" >

    < /p >

    < p >

    < label for 'e-mail address' = > E-mail address: < / label > < br >

    < input type = "text" name = "email" > < br >

    < /p >

    < p >

    < label for = "e-mail address" > phone number: < / label > < br >

    < input type = "text" name = "phone" > < br >

    < /p >

    < p >

    < label for 'message' = > Message: < / label > < br >

    < textarea = 'message' name > < / textarea >

    < /p >

    < input type = "submit" value = "Submit" > < br >

    < / make >


    Hi Luke,.

    CAPTCHAs cause form several failures of deposit than successes.  They should be used only as a last resort because these enigmatic symbols are often difficult to read and not easy to use.

    If you want to outsmart spam robots without penalizing humans, use a pot of honey or an input field hidden in your form.  Spambots are stupid and will try to fill any form field they encounter whether hidden or not.   If the hidden field is filled, your form processing script can be programmed to give up the presentation.   Humans never see it & spambots are stopped dead in their tracks.  This method is very reliable and easy to use.

    Nancy O.

  • Need help fixing windows update 80073712 error code.

    Whenever I try to check for any update I get error code 80073712. I am running windows vista as my operating system. Is there anyway that I can fix this?

    http://support.Microsoft.com/kb/957310

    Above Microsoft link has 3 methods ot try to fix your error Code >

    Method 1: Run (Checksur.exe) system update readiness tool

    1. Download and run the system update readiness tool. This tool runs an ad hoc analysis of inconsistencies that might prevent future maintenance operations.

      For more information about how to download and run the Checksur.exe tool, click on the number below to view the article in the Microsoft Knowledge Base:

      947821 (http://support.microsoft.com/kb/947821/) Description of the update readiness tool for Windows Vista system
    2. Try to install updates again.

    Note After running the tool, the Checksur.log file is stored in the following location:

    %SystemRoot%\Logs\CBS

    In a default installation of Windows Vista, SystemRoot is the Windows directory.

    If this method does not resolve the problem, go to method 2.

    Method 2: Install Windows Vista Service Pack 1 if you have not yet installed Windows Vista Service Pack 1 (SP1), visit the Microsoft Download Center and then download and install Service Pack 1. To do this, follow these steps:

    1. Quit all programs, and then click on the following link:

      http://www.Microsoft.com/downloads/details.aspx?FamilyId=f559842a-9c9b-4579-b64a-09146a0ba746&displaylang=en (http://www.microsoft.com/downloads/details.aspx?FamilyID=f559842a-9c9b-4579-b64a-09146a0ba746&DisplayLang=en)

      Note Click the option to download on the download page, click Save, and then save the download to your desktop. When the download process is complete, click run to install the SP1.

    2. Restart the computer.
    3. Try to download the updates again.

    If you can't always install updates, go to method 3.

    Method 3: Perform a repair of Windows Vista installation when you perform a repair installation, which restores the current installation of Windows Vista to the version on the installation DVD. This requires you to reinstall all updates that do not appear in this version of Windows Vista.

    To perform a repair of Windows Vista installation, follow these steps:

    1. Restart the computer.
    2. Insert the Windows Vista DVD into the DVD drive of the computer.

      Note If Windows does not automatically detect the DVD, click Start, type : \setup.exe in the Search box, and then click configuration in the list programs. Then click on install now.

    3. Click connect to get the latest updates for installation (recommended).
    4. Insert the product key if you are prompted to do so.
    5. Click to accept the Microsoft software license agreement.
    6. On the screen which type of installation you want , click upgrade.
    7. Once the installation is complete, restart the computer, and then try again to install updates.

    Mick Murphy - Microsoft partner

  • Need help resolution Windows 7 update error code 80242016 for update KB3185330 * IMPORTANT UPDATE

    I installed 5 updates to windows that have been brought to my attention.  4 5 updates were installed successfully.  But 1 updates that is marked "Important" CANNOT install.  The update is "KB3185330", it says it's an update to "October 2016 cumulative monthly security for Windows 7 x 64 based systems quality".  Can someone please help me to rectify this & this update installed successfully.  I never had problems before installing an update 'important '.  I am very concerned because I'm not a person tech savy, but I guess that if the update said '' significant '' than he SHOULD CERTAINLY be installed.  I kept all of my updates of Windows 7 since I got my computer.  I did NOT any changes to my computer before trying to update & as I said before, 4 other updates have been "successful".  I would appreciate the help of anyone who is well informed about it and can give me EASY instructions on what went wrong AND how to fix it.  Thank you in advance.

    Hello

    To address your concerns about the error message the update is not applicable to your computer , you can visit this link and follow the steps carefully.

    Let us know how it goes.

  • Need help in writing request

    Hello

    I need.

    I have me rank high 6 every time some contributions. as shown below.

    IDRank
    123431
    63562
    3463
    7674
    9885
    3436

    If the entry returns only 5 rows, I need data to be looked at like that.

    IDRank
    123431
    63562
    3463
    7674
    9885
    6

    I don't know what will be the number of rows of the query. so, every time, if I shoot a uery should return the top 6 lines and if it returns less than 6, then it should be replaced by an empty string to the line count six.

    Something like that

    with gen_6_row
    as
    (
      select level rno from dual connect by level <= 6
    )
    , your_query
    (
    
    )
    select a.rno, b.*
      from gen_6_row a
      left join
           your_query b
        on a.rno = b.rank;
    
  • Hello [need help on 1 and 2 error codes]

    Hello

    I have a code error 1 or 2 that is displayed when the update of late July 2015

    has anyone there the same problem?

    [Title edited for clarity... MOD]

    Code 1 discussion https://forums.adobe.com/thread/1434528

    Code 2 https://forums.adobe.com/thread/1595922

Maybe you are looking for