EqualsIgnoreCase

I need to use equalsIgnoreCase to see if a string value matches the word "Yes" or not.
and I'm also asked about which one of the following ways I would choose, and why.
str = obj.getValue();
1) "Yes".equalsIgnoreCase(str);
2) str.equalsIgnoreCase("Yes");I know that they both work the same way; that is, they provide same results and both ways are frequently used. But I can't seem to find which one is a better one to use, after I've looked at the implementation of equalsIgnoreCase(String str) in String.java.
Could someone please explain this to me?
Thanks!

Thanks! You answered my question :-) I'll choose the 2nd one, then!

Similar Messages

  • EqualsIgnoreCase() and J2Me Polish

    Hi,
    I am making an application in J2Me Polish. My application is using equalsIgnoreCase() method.
    When i compile the application w/o Polish it works fine but it shows error when i compile it with the J2ME Polish.
    The error is: cannot resolve symbol.
    I have used Nokia/6681 group in the build.xml which supports MIDP 2.0/CLDC 1.1
    But it i s not able to resolve this method.
    Please help me in solving it.
    Regards,
    Divya

    thanks for the information but cant we use equalsIgnoreCase method anyhow in J2ME Polish.Is this the limitation of the J2ME Polish.......

  • Method equalsIgnoreCase raise java.lang.StackOverflowError

    Is anyone encountered the following? is it an encodiong problem (java.lang.CharacterDataLatin1 etc.)? thanks, david.
    executing:
    public int getColumnIndex(String column)
    int col_id = 0;
    String col_name = null;
    int count = 0;
    try
    if (columns != null)
    count = columns.length;
    for (int i = 0; i < count; i++)
    col_name = columns;
    if (col_name.equalsIgnoreCase(column))
    col_id = i;
    break;
    catch(Exception e)
    col_id = 0;
    e.printStackTrace();
    return col_id;
    raise:
    Exception in thread "Thread-5" java.lang.StackOverflowError
         at java.lang.CharacterDataLatin1.getProperties(CharacterDataLatin1.java:58)
         at java.lang.CharacterDataLatin1.toUpperCase(CharacterDataLatin1.java:156)
         at java.lang.Character.toUpperCase(Character.java:4307)
         at java.lang.Character.toUpperCase(Character.java:4274)
         at java.lang.String.regionMatches(String.java:1214)
         at java.lang.String.equalsIgnoreCase(String.java:950)
         at model.DataEntity.getColumnIndex(DataEntity.java:118)

    That's probably not the full stack trace? I'd say that you have an infinitive recursive call some where.
    Kaj

  • How can I use equalsIgnoreCase in JDBC Application to return database value

    How can I ensure that the code will return a name from the database by using equalsIgnoreCase().
    Please see below code .
    public class RetrievEmp {
    final static String FILE_NAME "c:\\project\\test.txt";
    /** Retrieves data from Employee table with the specified column
    * and employee's name.
    public String getDataFromEmpTable(String empname, String column) throws Exception {
    java.sql.Connection con = null;
    String query = "select " + column + " from owner.Employee where NAME = ?";
    ConnectionPool conPool = ConnectionPool.getPool();
    ResultSet rs = null;
    con = conPool.getConnection();
    PreparedStatement ps = con.prepareStatement(query);
         try {
              ps.setString(1, name);
         rs = ps.executeQuery();
              if(rs.next()) {
    rs.getString(1).equalsIgnoreCase(column);
         return rs.getString(1);
              else {
                   return null;
              finally {
                   try {
                        if(rs != null) {
                             rs.close();
                        if(con != null) {
                             con.close();
                        if(ps != null) {
                             ps.close();
                   }catch(Exception e){
         log.debug("Exception while closing connection");

    Thank you for your posting - The Member Feedback forum is not monitored by Oracle support or product teams and so Oracle product and technology related questions cannot be answered. However we recommend that you post this thread to the "Database - General" forum.
    The URL is: General Database Discussions
    Thanks - The OTN team

  • EqualsIgnoreCase problem

    Ok here's the deal, new to java and always having problems.
    For the class I'm in I had to create a program that would use equalsIgnoreCase to either terminate or continue the loop. That program worked just fine:
    import java.util.*;
    public class ExamAverager {
        public static void main(String[] args) {
                double sum;
                int numberOfStudents;
                double next;
                String answer;
                Scanner keyboard = new Scanner(System.in);
                do {
                     System.out.println("Enter all scores to be averaged.");
                     System.out.println("Enter a negative number after");
                     System.out.println("you have entered all the scores.");
                     sum = 0;
                     numberOfStudents = 0;
                     next = keyboard.nextDouble();
                     while (next >= 0)
                      sum = sum+next;
                      numberOfStudents++;
                      next = keyboard.nextDouble();
                          if (numberOfStudents > 0)
                               System.out.println("Average score: "+ (sum/numberOfStudents));
                          else
                               System.out.println("No scores to average.");
                          System.out.println("Want to average another exam?");
                          System.out.println("Enter yes or no.");
                          answer = keyboard.next();
                   }while (answer.equalsIgnoreCase("yes"));
    }Then we had to take the program and add to it, now it won't work. The compiler tells me it can't "find symbol variable answer"...can someone tell me the difference? or why it won't work this way? here's the new program code (nowhere near being done as I have awhile to go I don't even know if it will do what it is supposed to, but I can't find out b/c it won't get past the equalsIgnoreCase)
    import java.util.*;
    public class GradeCounter2 {
        public static void main(String[] args) {
             do {
                  double sum, nextNumGrade;
                 int numberOfStudents, countA, countB, countC, countD, countF;
                 String answer;
                 Scanner keyboard = new Scanner(System.in);
                  sum = 0;
                  nextNumGrade = 0;
                  numberOfStudents = 0;
                  countA = 0;
                  countB = 0;
                  countC = 0;
                  countD = 0;
                  countF = 0;
               while (nextNumGrade >= 0)
                        sum = sum+nextNumGrade;
                      numberOfStudents++;
                      if (nextNumGrade >= 90)
                             countA++;
                        else if (nextNumGrade >= 80)
                             countB++;
                        else if (nextNumGrade >= 70)
                             countC++;
                        else if (nextNumGrade >= 60)
                             countD++;
                        else if ((nextNumGrade < 60)&&(nextNumGrade >= 0))
                             countF++;
                        nextNumGrade = keyboard.nextDouble();
            System.out.println("Number of A's = " + (countA));
              System.out.println("Number of B's = " + (countB));
              System.out.println("Number of C's = " + (countC));
              System.out.println("Number of D's = " + (countD));
              System.out.println("Number of F's = " + (countF));
            if (numberOfStudents > 0)
                 System.out.println("The average is " + (sum/numberOfStudents));
              else
                   System.out.println("There were no scores to average.");
                 System.out.println("Want to average another exam?");
            System.out.println("Enter yes or no.");
                answer = keyboard.next();
              }while (answer.equalsIgnoreCase("yes"));
    }Thanks bunches!
    ^_^ Dannii

    nevermind - I got it, I had everything set inside the do loop. ok. now here is my code, all fixed up and works like a charm problem is that i need to have the exit question be "Please enter a score from 0 to 100 or (Negative Number) to quit" so I need to use an int to get out of it, can you use a boolean expression in an equalsIgnoreCase? I thought it had to be a String, so what do I do? use a System.exit(0)?
    import java.util.*;
    public class GradeCounter2 {
        public static void main(String[] args) {
                    double sum, nextNumGrade;
                 int numberOfStudents, countA, countB, countC, countD, countF;
                 String answer;
                 Scanner keyboard = new Scanner(System.in);
                  do {
                  sum = 0;
                  numberOfStudents = 0;
                  countA = 0;
                  countB = 0;
                  countC = 0;
                  countD = 0;
                  countF = 0;
                  System.out.println("Enter numerical grades");
                 System.out.println("in the range of 0 to 100 -");
                 System.out.println("integers, only, please!");
                 System.out.println();
                 System.out.println("Enter  (Negative Number) to terminate data entry.");
                  nextNumGrade = keyboard.nextDouble();
               while (nextNumGrade >= 0)
                        sum = sum+nextNumGrade;
                      numberOfStudents++;
                      if (nextNumGrade >= 90)
                             countA++;
                        else if (nextNumGrade >= 80)
                             countB++;
                        else if (nextNumGrade >= 70)
                             countC++;
                        else if (nextNumGrade >= 60)
                             countD++;
                        else if ((nextNumGrade < 60)&&(nextNumGrade >= 0))
                             countF++;
                        nextNumGrade = keyboard.nextDouble();
            System.out.println("Number of A's = " + (countA));
              System.out.println("Number of B's = " + (countB));
              System.out.println("Number of C's = " + (countC));
              System.out.println("Number of D's = " + (countD));
              System.out.println("Number of F's = " + (countF));
            if (numberOfStudents > 0)
                 System.out.println("The average is " + (sum/numberOfStudents));
              else
                   System.out.println("There were no scores to average.");
                 System.out.println("Want to average another exam?");
            System.out.println("Enter yes or no.");
                answer = keyboard.next();
              }while (answer.equalsIgnoreCase("yes"));
    }

  • Why does .equalsIgnoreCase() not return true when they're equal

    http://pastebin.com/m741df92b
    else if (message.matches("quit")) {
                   System.out.println("inside quit thingie");
                   // sender = sender.trim();
                   for (int i = 0; i < admins.size(); i++) {
                        String admin = admins.get(i);
                        System.out.println("testing :" + admin + ": vs :" + sender
                                  + ":");
                        if (sender.equalsIgnoreCase(admin)) {
                             System.out.println("quitting because of "
                                       + message.substring("quit".length() + 1));
                             super.quitServer(message.substring("quit".length() + 1));
                        } // end if
                   } // end for
    Output:  (the first bit is logging the incoming message)
    #TDWTFMafia:<btk> quit
    inside quit thingie
    testing :btk: vs :btk:Since posting the pastebin, I changed the code a bit so it would spit out the length along with what it's testing. that gave me
    testing :btk: (3) vs :btk: (3)

    Can you make sure the problem is not in
    System.out.println("quitting because of "+ message.substring("quit".length() + 1));
    super.quitServer(message.substring("quit".length() + 1));by replacing these 2 line with something like
    System.out.println("quitting);
    super.quitServer("quit");
    {code}
    Is the code you pasted surrounded by a try/catch statement? If message equals "quit" or something shorter your substring will throw a IndexOutOfBoundsException.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Help with equalsIgnoreCase()

    Okay, I'm basically playing about and trying to learn different things :).
    I've been trying to get equalsIgnoreCase() to work with a program I made:
         String t = "True";
              String f = "False";
              String ff = "";
              String starterInput = JOptionPane.showInputDialog(null, "Does the customer want a starter(true/false)?", "Starter choice", JOptionPane.QUESTION_MESSAGE);
              boolean starterChoice = starterInput.equalsIgnoreCase(t, f, ff);          
              if (starterChoice)
                        System.out.println("Success");So, what I'm trying to do is to make the starterChoice Boolean true if starterInput matches the t, f or ff strings. However, I get a D:\JavaPro\Etc\src\Test.java:13: equalsIgnoreCase(java.lang.String) in java.lang.String cannot be applied to (java.lang.String,java.lang.String,java.lang.String)
            boolean starterChoice = starterInput.equalsIgnoreCase(t,f,ff);..error when I try to compile it. It works with just t, but not with more. Why is this?
    Thanks.

    xcd wrote:
    It doesn't work with 2 strings though, just 1... Ideally I'd like to use 3 though, and can't see why that would be a problem with the function if it does allow 2...No, it uses 2. The one you invoke the method on, and the one you pass in as an argument

  • Use hashCode() to compare strings instead of equalsIgnoreCase()

    The HashCode method has a contract which says
    " If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result. "
    Hence does it not make sense to use hashcode() method to compare two strings instead of using equals() method ? For example instead of using
    String s = "One";
    System.out.println("Strings equal = "+s.equals("Two"));
    we can write
    String s = "One";
    System.out.println("Strings equal = "+(s.hashCode()=="Two".hashCode()));

    Here is just a short list of strings with 3 characters that has the same hashcodes:
    2NX and 2O9 has same hashCode 50556
    3NX and 3O9 has same hashCode 51517
    4NX and 4O9 has same hashCode 52478
    5NX and 5O9 has same hashCode 53439
    6NX and 6O9 has same hashCode 54400
    7NX and 7O9 has same hashCode 55361
    8NX and 8O9 has same hashCode 56322
    9NX and 9O9 has same hashCode 57283
    :NX and :O9 has same hashCode 58244
    ;NX and ;O9 has same hashCode 59205
    <NX and <O9 has same hashCode 60166
    =NX and =O9 has same hashCode 61127
    NX and >O9 has same hashCode 62088?NX and ?O9 has same hashCode 63049
    @NX and @O9 has same hashCode 64010
    ANX and AO9 has same hashCode 64971
    BNX and BO9 has same hashCode 65932
    CNX and CO9 has same hashCode 66893
    DNX and DO9 has same hashCode 67854
    ENX and EO9 has same hashCode 68815
    FNX and FO9 has same hashCode 69776
    GNX and GO9 has same hashCode 70737
    HNX and HO9 has same hashCode 71698
    INX and IO9 has same hashCode 72659
    JNX and JO9 has same hashCode 73620
    KNX and KO9 has same hashCode 74581
    LNX and LO9 has same hashCode 75542
    MNX and MO9 has same hashCode 76503
    NNX and NO9 has same hashCode 77464
    ONX and OO9 has same hashCode 78425
    PNX and PO9 has same hashCode 79386
    QNX and QO9 has same hashCode 80347
    RNX and RO9 has same hashCode 81308
    SNX and SO9 has same hashCode 82269
    TNX and TO9 has same hashCode 83230Kaj

  • Difference in Null and Empty String

    Hi,
    I have been wondering about the difference between Null and Empty String in Java. So I wrote a small program like this:
    public class CompareEmptyAndNullString {
         public static void main(String args[]) {
              String sNull = null;
              String sEmpty = "";
              try {
                   if (sNull.equalsIgnoreCase(sEmpty)) {
                        System.out.println("Null and Empty Strings are Equal");
                   } else {
                        System.out.println("Null and Empty Strings are Equal");
              } catch (Exception e) {
                   e.printStackTrace();
    This program throws Exception: java.lang.NullPointerException
         at practice.programs.CompareEmptyAndNullString.main(CompareEmptyAndNullString.java:10)
    Now if I change the IF Clause to if (sEmpty.equalsIgnoreCase(sNull)) then the Program outputs this: Null and Empty Strings are Equal
    Can anyone explain why this would happen ?
    Thanks in Advance !!

    JavaProwler wrote:
    Saish,
    Whether you do any of the following code, the JUnit Test always passes: I mean he NOT Sign doesnt make a difference ...
    assert (! "".equals(null));
    assert ("".equals(null));
    You probably have assertions turned off. Note the the assert keyword has nothing to do with JUnit tests.
    I think that older versions of JUnit, before assert was a language keyword (which started in 1.4 or 1.5), had a method called assert. Thus, if you have old-style JUnit tests, they might still compile, but the behavior is completely different from what it was in JUnit, and has nothing to do with JUnit at all.
    If you turn assertions on (-ea flag in the JVM command line, I think), the second one will throw AssertionError.

  • Image is not saved in jpeg/bmp file but ok with png

    Hi i am unable to save the image in disk in jpeg format.
    Here is the code.
    public void saveImage(){
    //if no filechooser is there means no image file opened.
            if(fileChooser==null){
                if(errorWindow==null)
                    errorWindow=new ErrorWindow(XXX.getPrimaryStage());
                errorWindow.showErrorWindow("There is no image to save !!\n");
            else{
                fileChooser.setTitle("Save The Image");
                File saveFile=fileChooser.showSaveDialog(XXX.getPrimaryStage());
                if(saveFile!=null){
                    System.out.println("saveFile path= "+saveFile);
                    //get the extension of output image to be saved.
                    //XXX: is the main class name(say)
                    outExtension=*XXX*.getImageExtension(saveFile);
                    //if user does not give extension: set default extension as jpg
                    if(outExtension.equalsIgnoreCase(saveFile.getName())){
                        outExtension="jpg";                   
                        String newPath=(saveFile.toString())+".jpg";
                        saveFile=new File(newPath);                   
                    Task task = new Task<Void>() {
                        @Override
                        public Void call() {
                            Platform.runLater(
                                    new Runnable() {
                                        public void run() {
                                            try {
                                                //The image is inside ImageView->inside ScrollPane-> inside TabPane.
                                                Image curImage=XXX.getCurrentImage();
                                                int width=(int)curImage.getWidth();
                                                int height=(int)curImage.getHeight();                              
                                                System.out.println("cur image width= "+width+" ht= "+height);
                                                bufferedImage=new BufferedImage(width, height,BufferedImage.TYPE_INT_ARGB );
                                                //set the current image to awt Buffered Image
                                                SwingFXUtils.fromFXImage(curImage, bufferedImage);
                                                    imageTabPane=xxx.getImageTabPane();
                                                    Tab tab=imageTabPane.getSelectionModel().getSelectedItem();                                    
                                                    TabPane childTabPane=(TabPane)tab.getContent();
                                                    ScrollPane sp=(ScrollPane)childTabPane.getSelectionModel().getSelectedItem().getContent();
                                                    final ImageView imageView=(ImageView)sp.getContent();
                                                    WritableImage wim = new WritableImage(width,height);
                                                    imageView.snapshot(null, wim);
                                                    System.out.println(" snapShot width= "+wim.getWidth()+" ht="+wim.getHeight());                             
                                                    *ImageIO.write(SwingFXUtils.fromFXImage(wim,null), outExtension, saveFile);*
                                                       //<------ its not working  for png,jpeg,bmp,gif                                          
                                                    // the below lines are working only for png and gif
                                                    OutputStream out = new FileOutputStream(saveFile);                                                
                                                    ImageIO.write((RenderedImage) bufferedImage, outExtension, out);
                                                    out.flush();
                                            } catch (Exception ex) {
                                                Logger.getLogger(FileMenuController.class.getName()).log(Level.SEVERE, null, ex);
                                                //ex.printStackTrace();
                                            System.out.println("finished");
                            return null;
                    Thread th = new Thread(task);
                    th.start();
                }else{
                    System.out.println("File is not saved");
        }//saveImageNote: The above code is executed in ubuntu(10.04) using Netbeans 7.2(Javafx(2.2), java(1.7.0_11).
    When i run(from terminal) separately in a new class with an image in an Imageview( inside a Vbox) and take the snapshot
    of the imageview and write into the file using ImageIO.write(SwingFXUtils.fromFXImage(wim,null), outExtension, saveFile);
    with any extension (jpeg,png etc) it is working fine.
    Please help me.
    Any small hint is also helpful.Please feel free to comment or give suggestion.
    Edited by: 963038 on Feb 17, 2013 7:14 PM

    When i omit the line OutputStream out = new FileOutputStream(saveFile);
    and write only
    ImageIO.write((RenderedImage) bufferedImage, outExtension,saveFile);
    //out.flush();
    then saving the image even in "png" also fails.
    The following is the error code:
    Note : FileMenuController is my file where the saveImage() is wrtten.
    javax.imageio.IIOException: I/O error writing PNG file!
    finished
         at com.sun.imageio.plugins.png.PNGImageWriter.write(PNGImageWriter.java:1168)
         at javax.imageio.ImageWriter.write(ImageWriter.java:615)
         at javax.imageio.ImageIO.doWrite(ImageIO.java:1612)
         at javax.imageio.ImageIO.write(ImageIO.java:1536)
         at *newciptk.controls.menu.file.FileMenuController$1$1.run(FileMenuController.java:205)*
         at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:173)
         at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
         at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
         at com.sun.glass.ui.gtk.GtkApplication$3$1.run(GtkApplication.java:82)
         at java.lang.Thread.run(Thread.java:722)
    Caused by: java.io.IOException: Operation not supported
         at java.io.RandomAccessFile.writeBytes(Native Method)
         at java.io.RandomAccessFile.write(RandomAccessFile.java:499)
         at javax.imageio.stream.FileImageOutputStream.write(FileImageOutputStream.java:124)
         at javax.imageio.stream.ImageOutputStreamImpl.writeInt(ImageOutputStreamImpl.java:91)
         at com.sun.imageio.plugins.png.ChunkStream.finish(PNGImageWriter.java:136)
         at com.sun.imageio.plugins.png.PNGImageWriter.write_IHDR(PNGImageWriter.java:401)
         at com.sun.imageio.plugins.png.PNGImageWriter.write(PNGImageWriter.java:1135)
         ... 9 more
    javax.imageio.IIOException: I/O error writing PNG file!
         at com.sun.imageio.plugins.png.PNGImageWriter.write(PNGImageWriter.java:1168)
         at javax.imageio.ImageWriter.write(ImageWriter.java:615)
         at javax.imageio.ImageIO.doWrite(ImageIO.java:1612)
         at javax.imageio.ImageIO.write(ImageIO.java:1536)
         at newciptk.controls.menu.file.FileMenuController$1$1.run(FileMenuController.java:205)
         at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:173)
         at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
         at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
         at com.sun.glass.ui.gtk.GtkApplication$3$1.run(GtkApplication.java:82)
         at java.lang.Thread.run(Thread.java:722)
    Caused by: java.io.IOException: Operation not supported
         at java.io.RandomAccessFile.writeBytes(Native Method)
         at java.io.RandomAccessFile.write(RandomAccessFile.java:499)
         at javax.imageio.stream.FileImageOutputStream.write(FileImageOutputStream.java:124)
         at javax.imageio.stream.ImageOutputStreamImpl.writeInt(ImageOutputStreamImpl.java:91)
         at com.sun.imageio.plugins.png.ChunkStream.finish(PNGImageWriter.java:136)
         at com.sun.imageio.plugins.png.PNGImageWriter.write_IHDR(PNGImageWriter.java:401)
         at com.sun.imageio.plugins.png.PNGImageWriter.write(PNGImageWriter.java:1135)
         ... 9 more

  • File not found error

    I get the following error, but don't know why it can't find the file. Is there anything in this script that would call "\" instead of "/"? Is there any line of code that will switch a wayward "\" back?
    01-09-24 09:37:02 - path="" :jsp: init
    2001-09-24 09:43:42 - path="" :LoginServlet: init
    2001-09-24 09:44:15 - path="" :CourseServlet: init
    2001-09-24 09:46:48 - path="" :LessonServlet: init
    2001-09-24 09:46:54 - path="" :Error: /usr/local/apache/sites/tesco.spinweb.net/htdocs/cmi/courses\Food Service/Intro/AU00.html (No such file or directory)
    The script is below. Thanks for any help anyone can provide me.
    import cmi.xml.AU;
    import cmi.xml.Block;
    import cmi.xml.CourseReader;
    import cmi.xml.CSFElement;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.IOException;
    import java.io.ObjectInputStream;
    import java.io.PrintWriter;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.Enumeration;
    import java.util.Hashtable;
    import java.util.Vector;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.ServletOutputStream;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    import javax.servlet.http.HttpServlet;
    import org.jdom.JDOMException;
    public class LessonServlet extends HttpServlet
    public void init (ServletConfig config) throws ServletException
    super.init (config);
    try {
                   Class.forName (GlobalData.DatabaseDriverName);
                   _jdbcConnection = DriverManager.getConnection (GlobalData.DatabaseName, "tesco", "scorm");
    _jdbcConnection.setAutoCommit (true);
    //should I do this?
    //_jdbcConnection.setAutoCommit (false);
    //load serialized course data
    loadCourseData();
              catch (Exception xcp) {
                   xcp.printStackTrace();     
                   getServletContext().log("Error: " + xcp.getMessage());     
    public void doGet( HttpServletRequest request,
                             HttpServletResponse response)
              throws ServletException, IOException
    boolean normalMode = true;
    try {
    HttpSession session = request.getSession (true);
    //can I load the session given the id??
    //System.out.println ("Lesson.valid session " + session.getId() + ": " + request.isRequestedSessionIdValid());
    response.setContentType ("text/html");
    JDBCHelper dbHelper = new JDBCHelper (_jdbcConnection);
    //get student ID
    Integer studentID = (Integer) session.getAttribute ("studentID");
    //get course ID
    Integer courseID = (Integer) session.getAttribute ("courseID");
    //get lesson ID
    String lessonID = request.getParameter ("lessonID");
    if (lessonID == null) {
    lessonID = (String) session.getAttribute ("lessonID");
    if (studentID == null || courseID == null || lessonID == null) {
    //reset session data by re-logging the user
    sendProfileError (response.getOutputStream());
    return;
    //store lesson ID in session
    session.setAttribute ("lessonID", lessonID);
    String auID = request.getParameter ("auID");
    String mode = request.getParameter ("mode");
    if (mode != null) {
    session.setAttribute ("mode", mode);
    else {
    mode = (String) session.getAttribute ("mode");
    if (mode.equalsIgnoreCase ("review")) {
    normalMode = false;
    else {
    normalMode = true;
    //synchronize access to course hash table
    synchronized (_courseHash)
    //make sure _courseHash is in tact
    if (_courseHash == null) {
    //try reloading it....
    loadCourseData();
    if (_courseHash == null) {
    //error
    response.getOutputStream().close();
    throw new IOException ("Corrupt course data");
    if (! _courseHash.containsKey (courseID.toString())) {
    //try reloading it....
    loadCourseData();
    if (! _courseHash.containsKey (courseID.toString())) {
    //error
    response.getOutputStream().close();
    throw new IOException ("Corrupt course data (course not found)");
    if (auID == null) {
    //show course menu
    Hashtable hash = (Hashtable) _courseHash.get (courseID.toString());
    sendAvailableAUs (hash, studentID.intValue(), courseID.intValue(), lessonID, response.getOutputStream(), response, dbHelper);
    return;
    //if AU has not been attempted, initialize it
    Integer auDataID = new Integer (getAUDataID (studentID.intValue(), courseID.intValue(), lessonID, auID, dbHelper));
    //if (getAUDataID (studentID.intValue(), courseID.intValue(), lessonID, auID, dbHelper) == -1) {
    if (auDataID.intValue() == -1) {
    int newID = initializeAUData (studentID.intValue(), courseID.intValue(), lessonID, auID, dbHelper);
    dbHelper.addAUToPath (studentID.intValue(), courseID.intValue(), lessonID, auID);
    auDataID = new Integer (newID);
    session.setAttribute ("AUID", auID);
    session.setAttribute ("AUDataID", auDataID);
    sendAU (studentID.intValue(), courseID.intValue(), lessonID, auID, auDataID.intValue(), normalMode, response.getOutputStream(), dbHelper);
    //to do: detailed messages should be sent to the client depending on which
    // exception was thrown. Don't have one try/catch....have one for each situation
    catch (Exception e) {
    e.printStackTrace();
                   getServletContext().log("Error: " + e.getMessage());
    public void destroy()
              try {
                   if (_jdbcConnection != null) {
                        _jdbcConnection.close();
              catch (Exception ignored) {}
    private int initializeAUData (int studentID, int courseID, String lessonID, String auID, JDBCHelper dbHelper)
    String sqlQuery = null;
    ResultSet results = null;
    try {
    //get student's name
    sqlQuery = "SELECT Full_Name" +
    " FROM " + GlobalData.StudentTable +
    " WHERE Student_ID = " + studentID;
    results = dbHelper.doQuery (sqlQuery);
    if (! results.next()) {
    //error
    return -1;
    String studentName = results.getString (1);
    results.close();
    //the lock prevents CMIServlet from reading AU_ID before it's committed
    //sqlQuery = "LOCK TABLES " + GlobalData.AUDataTable + " WRITE;";
    //System.out.println (sqlQuery);
    //dbHelper.executeUpdate (sqlQuery);
    sqlQuery = "Insert Into " + GlobalData.AUDataTable +
    "(Course_ID, Lesson_ID, AU_ID, student_id, student_name, lesson_location, credit," +
    " lesson_status, entry, exit, score_raw, score_max, score_min, total_time," +
    " session_time, lesson_mode, suspend_data, launch_data, Evaluation_ID, Objective_ID)" +
    " Values (" + courseID + ", '" + lessonID + "', '" + auID + "', " + studentID + ", '" + studentName + "'," +
    " 'NA', 'credit'," + " 'not attempted', 'ab-initio', " + "'NA', " + 0 + ", " + 0 + ", " + 0 +
    ", '00:00:00.0', '00:00:00.0', " + " 'normal'" + ", 'NA', " + "'NA', " + 0 + ", " + 0 + ");";
    dbHelper.executeUpdate (sqlQuery);
    return getAUDataID (studentID, courseID, lessonID,auID, dbHelper);
    //sqlQuery = "UNLOCK TABLES;";
    //System.out.println (sqlQuery);
    //dbHelper.executeUpdate (sqlQuery);
    catch (Exception e) {
    e.printStackTrace();
                   getServletContext().log("Error: " + e.getMessage());
    return -1;
    private int getAUDataID (int studentID, int courseID, String lessonID, String auID, JDBCHelper dbHelper)
    throws SQLException
    String sqlQuery = "SELECT AUData_ID, lesson_status, lesson_mode, exit" +
                                  " FROM " + GlobalData.AUDataTable +
                                  " WHERE student_id = " + studentID +
                                  " AND Course_ID = " + courseID +
    " AND Lesson_ID = " + "'" + lessonID + "'" +
    " AND AU_ID = '" + auID + "';";
    ResultSet results = dbHelper.doQuery (sqlQuery);
    if (results.next()) {
    return results.getInt ("AUData_ID");
    return -1;
    private void sendAU (int studentID, int courseID, String lessonID, String auID, int auDataID, boolean normalMode, ServletOutputStream htmlOut, JDBCHelper dbHelper)
    throws IOException, ClassNotFoundException
    Hashtable hash = null;
    synchronized (_courseHash)
    hash = (Hashtable) _courseHash.get (String.valueOf (courseID));       
    if (hash == null) {
    loadCourseData();
    hash = (Hashtable) _courseHash.get (String.valueOf (courseID));
    if (hash == null) {
    throw new IOException ("Corrupt course data (course not found)");
    AU au = (AU) hash.get (auID);
    try {
    if (! normalMode) {
    dbHelper.setReviewMode (auDataID);
    String courseFileName = getFileName (String.valueOf (courseID), dbHelper);
    File file = new File (courseFileName);
    //create absolute path to file so we can resolve relative URLs
    String newFileName = file.getParent() + "\\" + au.getLaunchParams();
                   BufferedReader buf = new BufferedReader (new FileReader (newFileName));
    PrintWriter htmlWriter = new PrintWriter (htmlOut);
                   String temp;
    htmlWriter.write (getAUHtml (au.getLaunchParams()));
    htmlWriter.flush();
    htmlWriter.close();
    catch (Exception e) {
    e.printStackTrace();
                   getServletContext().log("Error: " + e.getMessage());
    private String getAUHtml (String path){
    path = path.replace ('\\','/');
    String response;
    response = "<html>\n" +
                        "<head>\n" +
    "</head>\n" +
    "<body>\n" +
    "<script language=\"JavaScript\">\n" +
    "document.location = \"/cmi/courses/" + path + "\"\n" +
    //"win = window.open ('','displayWindow','menubar=yes,scrollbars=yes,status=yes,width=300,height=300');\n" +
    //"window.onload = \"win.close();\"" +
    "</script>\n" +
    "</body>\n" +
    "</html>\n";
    return response;
    private void sendAvailableAUs (Hashtable hash, int studentID, int courseID, String lessonID, ServletOutputStream out, HttpServletResponse response, JDBCHelper dbHelper)
    StringBuffer buf = new StringBuffer (200);
    Block block = (Block) hash.get (lessonID);
    AU au = null;
    try {
    Vector completedAUs = dbHelper.getCompletedAUs (studentID, courseID, lessonID);
    buf.append ("<html>\n" +
                        "<head>\n" +
    "<title>" + block.getTitle() + " units</title>\n" +
    "<script language=\"JavaScript\">\n" +
    "function go() {\n" +
    " var form = document.goForm;\n" +
    " var index = form.gotoSelect.selectedIndex;\n" +
    " if (index == 0) {\n" +
    " document.location = \"/servlet/CourseServlet?courseID=" + courseID + "\";\n" +
    " }\n" +
    " else if (index == 1) {\n" +
    " top.restart();\n" +
    " }\n" +
    "}\n" +
    "</script>\n" +
    "</head>\n" +
    "<body background=\"/cmi/images/marble.jpg\">\n" +
    "<center><h1><b><u>" + block.getTitle() + "</u></b></h1></center>\n" +
    "<p></p>\n<p></p>\n" +
    "<b>" + block.getTitle() + " contains the following units: </b>\n" +
    "<dl>\n");
    Enumeration enum = block.getChildren();
    while (enum.hasMoreElements()) {
    String temp = (String) enum.nextElement();
    CSFElement element = (CSFElement) hash.get (temp);
    if (element.getType().equals ("au")) {
    au = (AU) element;
    if (completedAUs.contains (au.getID())) {
    buf.append ("<dt><p><img src=\"/cmi/images/node2.gif\"><a href=\"/servlet/LessonServlet?lessonID=" + block.getID() + "&auID=" + au.getID() + "&mode=review\">" + au.getTitle() + " (<i>review</i>) </a></p></dt>\n");
    else {
    buf.append ("<dt><p><img src=\"/cmi/images/node.gif\"><a href=\"" + response.encodeURL ("/servlet/LessonServlet?lessonID=" + block.getID() + "&auID=" + au.getID() + "&mode=normal") + "\">" + au.getTitle() + "</a></p></dt>\n");
    else if (element.getType().equals ("block")) {
    buf.append ("<dt><p><img src=\"/cmi/images/folder.gif\"><a href=\"" + response.encodeURL ("/servlet/LessonServlet?lessonID=" + element.getID() + "&mode=normal") + "\">" + element.getTitle() + "</a></p></dt>\n");
    buf.append ("</dl>\n" +
    "<br><br>\n" +
    "<form name=\"goForm\">\n" +
    "<select name=\"gotoSelect\">\n" +
    " <option value=\"lesson\">Lesson Menu</option>\n" +
    " <option value=\"exit\">Exit LMS</option>\n" +
    "</select>\n" +
    "<input type=\"button\" value=\"Go\" onClick=\"go()\">\n" +
    "</form>\n" +
    "</body>\n" +
    "</html>");
    PrintWriter writer = new PrintWriter (out);
    writer.write (buf.toString());
    writer.flush();
    writer.close();
    catch (Exception e) {
    e.printStackTrace();
                   getServletContext().log("Error: " + e.getMessage());
    private String getFileName (String courseID, JDBCHelper dbHelper)
    throws ClassNotFoundException, SQLException
              ResultSet results = null;
              String fileName = null;
    String sqlQuery = "SELECT CourseFile" +
                                  " FROM Course" +
                                  " WHERE Course_ID = " + Integer.parseInt (courseID) + ";";
    results = dbHelper.doQuery (sqlQuery);
              if (results.next()) {
                   fileName = results.getString (1);
              else {
    //need to do more than this :)
                   System.out.println("crap");
    results.close();
    return fileName;
    private void loadCourseData()
    throws IOException, ClassNotFoundException
    //load serialized course data
    File file = new File (GlobalData.DataFileName);
    if (! file.exists()) {
    //error
    throw new FileNotFoundException (GlobalData.DataFileName + " not found.");
    FileInputStream fis = new FileInputStream (GlobalData.DataFileName);
    ObjectInputStream ois = new ObjectInputStream (fis);
    _courseHash = (Hashtable) ois.readObject();
    ois.close();
    private void sendProfileError (ServletOutputStream out)
    String html = "<html>\n" +
    "<body>\n" +
    "<p>An error has occurred with your profile. Please " +
    "<a href=\"\" onClick=\"top.restart(); return true\">login again</a>" +
    "</body>\n" +
    "</html>\n";
    PrintWriter writer = new PrintWriter (out);
    writer.write (html);
    writer.flush();
    writer.close();
    private Connection _jdbcConnection;
    private Hashtable _courseHash;

    I know that is where my error is, but why and where is
    the script calling it up way?You wrote it right? check out the sendAU() method, there is line
    String newFileName = file.getParent() + "\\" + au.getLaunchParams();

  • Find line number in text file

    Hi all,
    I need to find the line numbers on a file where a particular string matches.
    for example:
    A lazy cat
    A strong cat and it is black
    Black is not good
    So I will match for the word black and it will give the numbers say line 2 and 3 it found the match.
    I am using the code:
    try{
        // Open the file that is the first
        // command line parameter
          FileInputStream fstream = new FileInputStream("c:\\test.log");
        // Get the object of DataInputStream
          DataInputStream in = new DataInputStream(fstream);
          BufferedReader br = new BufferedReader(new InputStreamReader(in));
          String strLine;
         String[] arr= null;
        //Read File Line By Line
       String regex = "black";
       while ((strLine = br.readLine()) != null)   {
        // Split the sentence into strings based on space
           arr = strLine.split("\\s");
       if (arr[0].equalsIgnoreCase("black"))
          System.out.print("match found");
        Pattern p = Pattern.compile(regex);
        Matcher m = p.matcher(strLine);Thanks in advance.

    camellia wrote:
    I need to find the line numbers on a file where a particular string matches. Then declare a variable for line count. Find where you read in a line. Finally increment this variable each time a line is read.
    It isn't rocket science.
    Mel

  • Error while Enabling a user in OIM

    Hi,
    I have a requirement where i need to disable and enable OIM users based on a UDF . If the UDF says Active user should be enabled and if it says "deleted" user should be disabled. I'm able to "Disable" a user present in "Active" state but not vice versa. My entity adapter is as follows
    statusUpdate(String userKey,String Status){
              OIMConnectionManagerImpl oimConn = new OIMConnectionManagerImpl();
              tcUserOperationsIntf tcUser = oimConn.getUserAPI();
              tcResultSet tcres = null;
                   HashMap map = new HashMap();
                   map.put("Users.Key",userKey);                    
                   tcres = tcUser.findUsers(map);
                   String s1=tcres.getStringValue("Users.Status");
                   if(Status.equalsIgnoreCase("Active") )
                        if(s1.equalsIgnoreCase("Disabled")){
                             tcUser.enableUser(Long.parseLong(userKey));
                   if(Status.equalsIgnoreCase("Deleted") )
                        if(s1.equalsIgnoreCase("Active")){
                             tcUser.disableUser(Long.parseLong(userKey));
    My error is as follows
    [com.oim.util.OIMConnectionManagerImpl] Unable to create factory instance
    java.lang.NullPointerException
    Edited by: user10665408 on Jul 1, 2009 3:14 PM

    I have done sm changes now:
    Try this.
    If some import is missing or some spelling mistakes are there just correct those. It's just for reference.
    Put import for map also.
    package com.Tst.oim;
    import Thor.API.Operations.tcUserOperationsIntf;
    import Thor.API.tcResultSet;
    import Thor.API.tcUtilityFactory;
    import com.thortech.xl.crypto.tcCryptoUtil;
    import com.thortech.xl.crypto.tcSignatureMessage;
    import com.thortech.xl.util.config.ConfigurationClient;
    import java.util.Hashtable;
    public class CreateFile {
    tcUtilityFactory utilFactory = null;
    tcSignatureMessage moSignature = null;
    tcUserOperationsIntf moUserUtility = null;
    tcResultSet userResultSet = null;
    ConfigurationClient.ComplexSetting myConfig =
    ConfigurationClient.getComplexSettingByPath("Discovery.CoreServer");
    final Hashtable env = myConfig.getAllSettings();
    public void Enable(String userid) {
    try {
    System.out.println("TRY");
    moSignature = tcCryptoUtil.sign("xelsysadm", "PrivateKey");
    utilFactory = new tcUtilityFactory(env, moSignature);
    moUserUtility = (tcuserOperations)utilfactory.getutility("Thor.API.Operations.tcUserOperations");
    Map a = new HashMap();
    a.put("Users.User ID", userid);
    tcResultSet userset = moUserUtility.findAllUsers(a);
    long ukey = userset.getLongValue("Users.Key");
    moUserUtility.enableuser(ukey);
    } catch (Exception e) {
    e.printStackTrace();
    Edited by: Dost

  • Stale data error while deleting a record

    Hi
    My design of this development is as follow...
    1. Search Page in which users give some search criteria and results will be displayed in the results region on the same page. For each results record I have two buttons like 'Update' and 'Delete' so that users can delete the record or can update the record. For update i created a one more page where users can able to edit and save the data. I have two AM one for Search Page and one for Update Page.
    Please find more details below.
    intfEO  based on PO_REQUISITIONS_INTERFACE_ALL
    errorEO  based on PO_INTERFACE_ERRORS
    updateEO based on PO_REQUISITIONS_INTERFACE_ALL
    VOs
    intfVO based on intfEO and errorEO
    updateVO based on updateEO
    AM
    intfAM based on intfVO
    updateAM based on updateVO
    Pages
    searchPG based on intfAM
    updatePG based on updateAM
    Suppose I have one record in interface table with corresponding error record in error table.When users given the search criteria and hit enter they found a record. It means i have one record in the interface having one error record in the error table and both tables have same transaction id (primary key). So here user first try to update the record and it is working. After update he try to delete a record then I am getting below error. Please note that I am not getting this error when if i directly delete the record with out doing any update before delete. When ever users click on update icon then update PG will open and when users click on Apply button then data is getting updated in the database and page will forward to the search page.
    Unable to perform transaction on the record.
    Cause: The record contains stale data. The record has been modified by another user.
    Action: Cancel the transaction and re-query the record to get the new data.
    My UpdatePage Controller
    /*===========================================================================+
    |   Copyright (c) 2001, 2005 Oracle Corporation, Redwood Shores, CA, USA    |
    |                         All rights reserved.                              |
    +===========================================================================+
    |  HISTORY                                                                  |
    +===========================================================================*/
    package powl.oracle.apps.xxpowl.po.requisition.webui;
    import com.sun.java.util.collections.HashMap;
    import com.sun.rowset.internal.Row;
    import java.io.Serializable;
    import oracle.apps.fnd.common.MessageToken;
    import oracle.apps.fnd.common.VersionInfo;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.OAViewObject;
    import oracle.apps.fnd.framework.webui.OAControllerImpl;
    import oracle.apps.fnd.framework.webui.OADialogPage;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.apps.fnd.framework.webui.beans.form.OASubmitButtonBean;
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageDateFieldBean;
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean;
    //import oracle.apps.fnd.oam.diagnostics.report.Row;
    import oracle.apps.icx.por.common.webui.ClientUtil;
    import powl.oracle.apps.xxpowl.po.requisition.server.xxpowlPOReqIntfUpdateAMImpl;
    import powl.oracle.apps.xxpowl.po.requisition.server.xxpowlPOReqIntfUpdateEOVOImpl;
    * Controller for ...
    public class xxpowlPOReqIntfAllUpdatePageCO extends OAControllerImpl
      public static final String RCS_ID="$Header$";
      public static final boolean RCS_ID_RECORDED =
            VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
       * Layout and page setup logic for a region.
       * @param pageContext the current OA page context
       * @param webBean the web bean corresponding to the region
      public void processRequest(OAPageContext pageContext, OAWebBean webBean)
        super.processRequest(pageContext, webBean);
         xxpowlPOReqIntfUpdateAMImpl am = (xxpowlPOReqIntfUpdateAMImpl)pageContext.getApplicationModule(webBean);
          xxpowlPOReqIntfUpdateEOVOImpl UpdateVO =(xxpowlPOReqIntfUpdateEOVOImpl)am.findViewObject("xxpowlPOReqIntfUpdateEOVOImpl");
          String newvalue = (String)pageContext.getSessionValue("testValue");     
          System.out.println("Transaction ID from processRequest UpdateCO from testValue field:"+newvalue);
          String transactionid = pageContext.getParameter("HashmapTransacitonid");
          System.out.println("Transaction ID from processRequest Hash Map in UpdateCO :"+transactionid);
          String errorcolumn = pageContext.getParameter("HashmapErrorcolumn");
          System.out.println("Error Column Name from processRequest Hash Map in UpdateCO :"+errorcolumn);
          String errormsg = pageContext.getParameter("HashmapErrormessage");
          System.out.println("Error Message from processRequest Hash Map in UpdateCO :"+errormsg);
          String readyonly = pageContext.getParameter("HashmapReadonly");
          System.out.println("Read Only value from processRequest Hash Map in UpdateCO :"+readyonly);
          if (transactionid !=null & !"".equals(transactionid)) { 
         /* Passing below four parameters to the Update Page */
          Serializable amParams[] = new Serializable[]{transactionid,readyonly,errorcolumn,errormsg} ;
          pageContext.getRootApplicationModule().invokeMethod("executexxpowlPOReqIntfUpdateEOVO", amParams);
       * Procedure to handle form submissions for form elements in
       * a region.
       * @param pageContext the current OA page context
       * @param webBean the web bean corresponding to the region
      public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
        super.processFormRequest(pageContext, webBean);      
         OAApplicationModule am = pageContext.getApplicationModule(webBean);
          if (pageContext.getParameter("ApplyButton") != null)
            System.out.println("Inside ApplyButton method in UpdatePageCO");
            OAViewObject vo = (OAViewObject)am.findViewObject("xxpowlPOReqIntfUpdateEOVO");
            String transactionid = pageContext.getParameter("HashmapTransacitonid");
            System.out.println("Transaction ID from processFormRequest Hash Map in UpdateCO-ApplyButton method :"+transactionid);
            am.invokeMethod("apply");
              pageContext.forwardImmediately("OA.jsp?page=/powl/oracle/apps/xxpowl/po/requisition/webui/xxpowlPOReqIntfAllPG",
                                                     null,
                                                     OAWebBeanConstants.KEEP_MENU_CONTEXT,
                                                     null,
                                                     null,
                                                     true,
                                                     OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
           else if (pageContext.getParameter("CancelButton") != null)
            am.invokeMethod("rollback");
            pageContext.forwardImmediately("OA.jsp?page=/powl/oracle/apps/xxpowl/po/requisition/webui/xxpowlPOReqIntfAllPG",
                                                   null,
                                                   OAWebBeanConstants.KEEP_MENU_CONTEXT,
                                                   null,
                                                   null,
                                                   true,
                                                   OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
    UpdatePageAMImpl.java
    package powl.oracle.apps.xxpowl.po.requisition.server;
    import oracle.apps.fnd.common.MessageToken;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.OARow;
    import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
    import oracle.apps.fnd.framework.OAViewObject;
    import oracle.apps.inv.appsphor.order.server.XxapOrderHeaderVOImpl;
    import oracle.jbo.Transaction;
    // ---    File generated by Oracle ADF Business Components Design Time.
    // ---    Custom code may be added to this class.
    // ---    Warning: Do not modify method signatures of generated methods.
    public class xxpowlPOReqIntfUpdateAMImpl extends OAApplicationModuleImpl {
        /**This is the default constructor (do not remove)
        public xxpowlPOReqIntfUpdateAMImpl() {
        /**Container's getter for xxpowlPOReqIntfUpdateEOVO
        public xxpowlPOReqIntfUpdateEOVOImpl getxxpowlPOReqIntfUpdateEOVO() {
            return (xxpowlPOReqIntfUpdateEOVOImpl)findViewObject("xxpowlPOReqIntfUpdateEOVO");
        /**Sample main for debugging Business Components code using the tester.
        public static void main(String[] args) {
            launchTester("powl.oracle.apps.xxpowl.po.requisition.server", /* package name */
          "xxpowlPOReqIntfUpdateAMLocal" /* Configuration Name */);
    /*  // Added by 
        public void execute_update_query(String TransactionID) {
        xxpowlPOReqIntfUpdateEOVOImpl vo = getxxpowlPOReqIntfUpdateEOVO();
        vo.initQuery(TransactionID);
    // Added by  , this will not call bec changed the logic and so now the update button enabled on search results page
    // and this method will not called
    public void pageInEditMode (String transactionID, String readOnlyFlag, String ErrorColumn,
                                                                           String ErrorMessage)
        System.out.println("Transaction Id from pageInEditMode in UpdatePGAMImpl.java: "+transactionID);
        System.out.println("xxReadOnly from pageInEditMode in UpdatePGAMImpl.java: "+readOnlyFlag);
        // Get the VO
        xxpowlPOReqIntfUpdateEOVOImpl updateVO = getxxpowlPOReqIntfUpdateEOVO();
        //Remove the where clause that was added in the previous run
        updateVO.setWhereClause(null);
        //Remove the bind parameters that were added in the previous run.
        updateVO.setWhereClauseParams(null);
        //Add where clause
        // updateVO.addWhereClause(" TRANSACTION_ID = :1 ");
        //Bind transactionid to the where clause.
         // updateVO.setWhereClauseParam(1, transactionID); // this will not work bec it will start with zero from from 1
          updateVO.setWhereClauseParam(0, transactionID);
        //Execute the query.
        updateVO.executeQuery();
        xxpowlPOReqIntfUpdateEOVORowImpl currentRow = (xxpowlPOReqIntfUpdateEOVORowImpl)updateVO.next();
        // Assiging the transient varaibles
        currentRow.setxxErrorMessage(ErrorMessage);
        currentRow.setxxErrorColumn(ErrorColumn);
        if ("N".equals(readOnlyFlag))
              /* Make the attribute to 'False so that all fields will be displayed in Edit Mode because we used this
               xxReadOnly as SPEL  */
               currentRow.setxxReadOnly(Boolean.FALSE);
       public void executexxpowlPOReqIntfUpdateEOVO(String transactionID, String xxReadyOnly, String ErrorColumn,
                                                                                              String ErrorMessage)
           System.out.println("Transaction Id from executexxpowlPOReqIntfUpdateEOVO in UpdatePGAMImpl.java: "+transactionID);
           System.out.println("xxReadOnly from executexxpowlPOReqIntfUpdateEOVO in UpdatePGAMImpl.java: "+xxReadyOnly);
           System.out.println("Error Message from executexxpowlPOReqIntfUpdateEOVO in UpdatePGAMImpl.java: "+ErrorColumn);
           System.out.println("Error Column from executexxpowlPOReqIntfUpdateEOVO in UpdatePGAMImpl.java: "+ErrorMessage);
         // Get the VO
         xxpowlPOReqIntfUpdateEOVOImpl updateVO = getxxpowlPOReqIntfUpdateEOVO();
         //xxpowlPOReqIntfUpdateEOVORowImpl updaterowVO = xxpowlPOReqIntfUpdateEOVO();
       //not working
       //    OARow row = (OARow)updateVO.getCurrentRow();
       //    row.setAttribute("xxReadOnly", Boolean.TRUE);
    // updateVO.putTransientValue('XXXXX',x);
         //Remove the where clause that was added in the previous run
         updateVO.setWhereClause(null);
         //Remove the bind parameters that were added in the previous run.
         updateVO.setWhereClauseParams(null);
         //Add where clause
         // updateVO.addWhereClause(" TRANSACTION_ID = :1 ");
         //Bind transactionid to the where clause.
          // updateVO.setWhereClauseParam(1, transactionID); // this will not work bec it will start with zero from from 1
           updateVO.setWhereClauseParam(0, transactionID);
        // updateVO.setWhereClauseParam(1, ErorrColumn); 
         //Execute the query.
         updateVO.executeQuery();
         /* We want the page should be read only initially so after executing the VO with above command
            and if you use next() it will go to the first record among the
            fetched records. If you want to iterate for all the records then use iterator */
            /* Using Iterator
             while(updateVO.hasNext()) {  // this will check after execute Query above command if it has any rows
              xxpowlPOReqIntfUpdateEOVORowImpl currentRow = (xxpowlPOReqIntfUpdateEOVORowImpl)updateVO.next();
              /* above line next() will take the control of the first record */
          /*     currentRow.setxxErrorMessage(ErrorMessage);
                 currentRow.setxxErrorColumn(ErrorColumn);
               if ("Y".equals(xxReadyOnly))
                      currentRow.setxxReadOnly(Boolean.TRUE);                 
             } // this while loop will loop till end of all the fetched records
         xxpowlPOReqIntfUpdateEOVORowImpl currentRow = (xxpowlPOReqIntfUpdateEOVORowImpl)updateVO.next();
      // Assiging the transient varaibles
      currentRow.setxxErrorMessage(ErrorMessage);
      currentRow.setxxErrorColumn(ErrorColumn);
        /* Make the attribute to 'TRUE' so that all fields will be displayed as READ ONLY because we used this
           xxReadOnly as SPEL
           if ("Y".equals(xxReadyOnly))
                  currentRow.setxxReadOnly(Boolean.TRUE);            
      //Added by  and this methiod will get called from UpdatePG Process Form Request controller  
         public void rollback()
           Transaction txn = getTransaction();
           if (txn.isDirty())
             txn.rollback();
        public void apply()
            //OAViewObject vo1 = (OAViewObject)getxxpowlPOReqIntfUpdateEOVO();
            //Number chargeAccountID = vo1.get
          getTransaction().commit();      
          OAViewObject vo = (OAViewObject)getxxpowlPOReqIntfUpdateEOVO();
          if (!vo.isPreparedForExecution())
           vo.executeQuery();
    SearchPG AM
    package powl.oracle.apps.xxpowl.po.requisition.server;
    import oracle.apps.fnd.framework.OAViewObject;
    import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
    import oracle.jbo.RowSetIterator;
    import oracle.jbo.Transaction;
    import oracle.jbo.domain.Number;
    import powl.oracle.apps.xxpowl.po.requisition.lov.server.xxpowlErrosLovVOImpl;
    import powl.oracle.apps.xxpowl.po.requisition.lov.server.xxpowlInterfaceSouceCodeLovVOImpl;
    import powl.oracle.apps.xxpowl.po.requisition.lov.server.xxpowlItemSegment1LovVOImpl;
    import powl.oracle.apps.xxpowl.po.requisition.lov.server.xxpowlOrgLovVOImpl;
    import powl.oracle.apps.xxpowl.po.requisition.lov.server.xxpowlReferenceNumberLovVOImpl;
    import powl.oracle.apps.xxpowl.po.requisition.lov.server.xxpowlRequestIdLovVOImpl;
    import powl.oracle.apps.xxpowl.po.requisition.lov.server.xxpowlRequisitionTypeLovVOImpl;
    // ---    File generated by Oracle ADF Business Components Design Time.
    // ---    Custom code may be added to this class.
    // ---    Warning: Do not modify method signatures of generated methods.
    public class xxpowlPOReqIntfAllAMImpl extends OAApplicationModuleImpl {
        /**This is the default constructor (do not remove)
        public xxpowlPOReqIntfAllAMImpl() {
        /**Container's getter for xxpowlPOReqIntfAllVO
        public xxpowlPOReqIntfAllVOImpl getxxpowlPOReqIntfAllVO() {
            return (xxpowlPOReqIntfAllVOImpl)findViewObject("xxpowlPOReqIntfAllVO");
        /**Sample main for debugging Business Components code using the tester.
        public static void main(String[] args) {
            launchTester("powl.oracle.apps.xxpowl.po.requisition.server", /* package name */
          "xxpowlPOReqIntfAllAMLocal" /* Configuration Name */);
        /**Container's getter for xxpowlRequestIdLovVO
        public xxpowlRequestIdLovVOImpl getxxpowlRequestIdLovVO() {
            return (xxpowlRequestIdLovVOImpl)findViewObject("xxpowlRequestIdLovVO");
        /**Container's getter for xxpowlErrosLovVO
        public xxpowlErrosLovVOImpl getxxpowlErrosLovVO() {
            return (xxpowlErrosLovVOImpl)findViewObject("xxpowlErrosLovVO");
        /**Container's getter for xxpowlOrgLovVO
        public xxpowlOrgLovVOImpl getxxpowlOrgLovVO() {
            return (xxpowlOrgLovVOImpl)findViewObject("xxpowlOrgLovVO");
      //Start Adding by Lokesh
      //This method wil get invoked from the search results page Process Request
       public void rollbackItem()
         Transaction txn = getTransaction();
         if (txn.isDirty())
           txn.rollback();
      //This method will invoked from Controller page when user click Yes on delete confirmtion page from Search Results Page
       public void deleteItem(String trasnsactionID)
         Number rowToDelete = new Number(Integer.parseInt(trasnsactionID));      
         OAViewObject vo = (OAViewObject)getxxpowlPOReqIntfAllVO();
         xxpowlPOReqIntfAllVORowImpl row = null;
         int fetchedRowCount = vo.getFetchedRowCount();
       //  System.out.print(fetchedRowCount);
         System.out.println("No of row fetched on delete method :"+fetchedRowCount);
         RowSetIterator deleteIter = vo.createRowSetIterator("deleteIter");
           System.out.println("1 :");
         if (fetchedRowCount > 0)
             System.out.println("2 :");
           deleteIter.setRangeStart(0);
             System.out.println("3 :");
           deleteIter.setRangeSize(fetchedRowCount);
             System.out.println("4 :");
           for (int i = 0; i < fetchedRowCount; i++)
               System.out.println("5 :");
             row = (xxpowlPOReqIntfAllVORowImpl)deleteIter.getRowAtRangeIndex(i);
               System.out.println("6 :");
             Number PK = row.getTransactionId();
               System.out.println("7 :");
             if (PK.compareTo(rowToDelete) == 0)
                 System.out.println("8 :");
               row.remove();
                 System.out.println("9 :");
               getTransaction().commit();
                 System.out.println("10 :");
               break;
                 //System.out.println("11 :");
           System.out.println("11 :");
         deleteIter.closeRowSetIterator();
           System.out.println("12 :");
        /**Container's getter for xxpowlInterfaceSouceCodeLovVO
        public xxpowlInterfaceSouceCodeLovVOImpl getxxpowlInterfaceSouceCodeLovVO() {
            return (xxpowlInterfaceSouceCodeLovVOImpl)findViewObject("xxpowlInterfaceSouceCodeLovVO");
        /**Container's getter for xxpowlRequisitionTypeLovVO
        public xxpowlRequisitionTypeLovVOImpl getxxpowlRequisitionTypeLovVO() {
            return (xxpowlRequisitionTypeLovVOImpl)findViewObject("xxpowlRequisitionTypeLovVO");
        /**Container's getter for xxpowlReferenceNumberLovVO
        public xxpowlReferenceNumberLovVOImpl getxxpowlReferenceNumberLovVO() {
            return (xxpowlReferenceNumberLovVOImpl)findViewObject("xxpowlReferenceNumberLovVO");
        /**Container's getter for xxpowlItemSegment1LovVO
        public xxpowlItemSegment1LovVOImpl getxxpowlItemSegment1LovVO() {
            return (xxpowlItemSegment1LovVOImpl)findViewObject("xxpowlItemSegment1LovVO");
    Search Page Controller
    /*===========================================================================+
    |   Copyright (c) 2001, 2005 Oracle Corporation, Redwood Shores, CA, USA    |
    |                         All rights reserved.                              |
    +===========================================================================+
    |  HISTORY                                                                  |
    +===========================================================================*/
    package powl.oracle.apps.xxpowl.po.requisition.webui;
    import com.sun.java.util.collections.HashMap;
    //import com.sun.java.util.collections.Hashtable;
    import java.util.Hashtable;
    //import java.util.HashMap;
    import java.io.Serializable;
    import javax.servlet.jsp.PageContext;
    import oracle.apps.fnd.common.MessageToken;
    import oracle.apps.fnd.common.VersionInfo;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.webui.OAControllerImpl;
    import oracle.apps.fnd.framework.webui.OADialogPage;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
    import oracle.apps.fnd.framework.webui.TransactionUnitHelper;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    * Controller for ...
    public class xxpowlPOReqIntfAllSearchPageCO extends OAControllerImpl
      public static final String RCS_ID="$Header$";
      public static final boolean RCS_ID_RECORDED =
            VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
       * Layout and page setup logic for a region.
       * @param pageContext the current OA page context
       * @param webBean the web bean corresponding to the region
      public void processRequest(OAPageContext pageContext, OAWebBean webBean)
        super.processRequest(pageContext, webBean);
        //Added by Lokesh
          OAApplicationModule am = pageContext.getApplicationModule(webBean);
         if (TransactionUnitHelper.isTransactionUnitInProgress(pageContext, "updateRecord", false)) {
               am.invokeMethod("rollbackItem");
               TransactionUnitHelper.endTransactionUnit(pageContext, "updateRecord");
       * Procedure to handle form submissions for form elements in
       * a region.
       * @param pageContext the current OA page context
       * @param webBean the web bean corresponding to the region
      public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
        super.processFormRequest(pageContext, webBean);
             String userClicked = pageContext.getParameter("event");
             System.out.println("Event from processFormRequest in SearchPageCO :"+userClicked);
           System.out.println("Parametere Names are :- \t" + pageContext.getParameter("UpdateImage"));
           System.out.println("Parametere Names are :- \t" + pageContext.getParameter("event"));
         if (pageContext.getParameter("event") != null &&
             pageContext.getParameter("event").equalsIgnoreCase("Update")) { 
             String ReqTransactionId=(String)pageContext.getParameter("transacitonidParam");
             String errorcolumn=(String)pageContext.getParameter("errorcolumnParam");
             String errormsg=(String)pageContext.getParameter("errormessageParam");
             String readyonly="Y"; //(String)pageContext.getParameter("readonlyParam");
             System.out.println("Requisition Transaction Id  : "+ReqTransactionId);
             System.out.println("Error Column  : "+errorcolumn);
             System.out.println("Error Message  : "+errormsg);
             System.out.println("Read Only  : "+readyonly);
             HashMap params = new HashMap(4);
             params.put("HashmapTransacitonid",ReqTransactionId);
             params.put("HashmapErrorcolumn",errorcolumn);
             params.put("HashmapErrormessage",errormsg);
             params.put("HashmapReadonly",readyonly);
             pageContext.putSessionValue("testValue",ReqTransactionId);
             //System.out.println("Transaction Id passing through HashMap :- \t" + ReqTransactionId);
             pageContext.setForwardURL("OA.jsp?page=/powl/oracle/apps/xxpowl/po/requisition/webui/xxpowlPOReqIntfAllUpdatePG",
                                        null,
                                        OAWebBeanConstants.KEEP_MENU_CONTEXT,
                                        null,
                                        params,
                                        true,
                                        OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
                                        OAWebBeanConstants.IGNORE_MESSAGES) ;   
    else if (pageContext.getParameter("event") != null &&
             pageContext.getParameter("event").equalsIgnoreCase("Delete")) {   
        System.out.println("Inside Delete method in SearchCO");
        String deleteTransactionID=(String)pageContext.getParameter("deleteTransactionIDParam");
        System.out.println("Transaction Id in Delete Method :- \t" + deleteTransactionID);
      //  deleteTransactionID ="";  //Makeing Null because dont want to show the transaction id bec users dont know about it
        //MessageToken[] tokens = { new MessageToken("MESSAGE_NAME", deleteTransactionID) };
        MessageToken[] tokens = { new MessageToken("MESSAGE_NAME", "") };
        OAException mainMessage = new OAException("FND", "FND_MESSAGE_DELETE_WARNING", tokens);
        OADialogPage dialogPage = new OADialogPage(OAException.WARNING,mainMessage, null, "", "");
        String yes = pageContext.getMessage("AK", "FWK_TBX_T_YES", null);
        String no = pageContext.getMessage("AK", "FWK_TBX_T_NO", null);
        dialogPage.setOkButtonItemName("DeleteYesButton");
        dialogPage.setOkButtonToPost(true);
        dialogPage.setNoButtonToPost(true);
        dialogPage.setPostToCallingPage(true);
        dialogPage.setOkButtonLabel(yes);
        dialogPage.setNoButtonLabel(no);
        Hashtable formParams = new Hashtable(1);
        formParams.put("transactionIdDeleted", deleteTransactionID);
        dialogPage.setFormP

    Hi friend ,
    In Search page i didn't do any update. and also search page is not a problem it's working fine. create page only the problem. In this page only throwing Stale data error exception.
    Please give me more suggestion.
    Thanks in advance,

  • Issue in RFCLookup UDF

    Hi All,
    Requesting your help in fixing an UDF issue.
    This UDF is to check for a table entry and if not found it will create an alert with some source values.
    Now the problem is, alert mails are getting created but the values are not getting passed.
    Here is the source code:
    AbstractTrace trace;
    trace = container.getTrace();
    MappingTrace trace1;
    trace1 = container.getTrace();
    Object cachedValue = null;
    String result = null;
    String sender = null;
    String receiver = null;
    //Check if source is null or blank. If so then pass blank value to target 
    if(((sourceValue1.trim()).equals("")) ||  ((sourceValue2.trim()).equals("")) || ((sourceValue3.trim()).equals("")))
      result="";
    else
                                 Map map = container.getTransformationParameters();
    //Sender System name which is the same as the Sender Business System name in Integration Directory
    sender = (String) map.get(StreamTransformationConstants.SENDER_SYSTEM);
    //Receiver System name which is the same as the Receiver Business System name in Integration Directory
    receiver = (String) map.get(StreamTransformationConstants.RECEIVER_SYSTEM);
    // Parameter for cache value. A semicolon is used as a separator between keys
    String CONTAINER_PARAMETER = subCat.trim() + UDFReader.getString("PARAMETER_DELIMETER") +sourceValue1.trim() + UDFReader.getString("PARAMETER_DELIMETER") +sourceValue2.trim() + UDFReader.getString("PARAMETER_DELIMETER") +sourceValue3.trim();
    trace1.addWarning("CONTAINER PARAMETER: " + CONTAINER_PARAMETER + "\n");
    trace.addDebugMessage(UDFReader.getString("CACHE_CONTAINER_PARAMETER_TEXT") + CONTAINER_PARAMETER);
    // Retrieve cached value
    cachedValue = container.getParameter(CONTAINER_PARAMETER);
    if(cachedValue!=null)
      // Cached value found
      result = cachedValue.toString();
      trace.addDebugMessage(UDFReader.getString("CACHE_RESULT_TEXT") + result);
    else
      // Cached value not present. Fetch value from database
      // Build key column names array to be passed to java class
      String keyColNames[] =new String[6];
      keyColNames[0]=UDFReader.getString("SAP_SYSTEM_COLUMN_NAME");
      keyColNames[1]=UDFReader.getString("LEGACY_SYSTEM_COLUMN_NAME");
      keyColNames[2]=UDFReader.getString("SUBCATEGORY_COLUMN_NAME");
      keyColNames[3]=sourceField1;
      keyColNames[4]=sourceField2;
      keyColNames[5]=sourceField3;
      trace1.addWarning("KeyColNames" + keyColNames[0] + "\n" + keyColNames[1] + "\n" + keyColNames[2] + "\n" + keyColNames[3] + "\n" + keyColNames[4] + "\n" + keyColNames[5] + "\n");
      // Build key column values array to be passed to java class
      String keyColValues[] = new String[6];
       //Check whether sender system is SAP or Legacy
                             if(sourceField1.startsWith(UDFReader.getString("SAP_SYSTEM_PREFIX")))
       //Sender system is SAP
       keyColValues[0]=sender;
       //Receiver system is Legacy
       keyColValues[1]=receiver;
                             else
       //Receiver system is SAP    
       keyColValues[0]=receiver;
       //Sender system is Legacy
       keyColValues[1]=sender;
      keyColValues[2]=subCat.trim();
      keyColValues[3]=sourceValue1.trim();
      keyColValues[4]=sourceValue2.trim();
      keyColValues[5]=sourceValue3.trim();
      // Fetch result using java class
      result=RfcLookupHandler.RFCLookup(table,keyColNames, 
    keyColValues,targetField,trace);
    trace1.addWarning("Result:" + result);
      if(!result.equals(RfcLookupHandler.VALNOTFOUND))
       // Record found in database
       container.setParameter(CONTAINER_PARAMETER,result);
      else
       // Record not found in database
                                              //Autogenerated message id generated at runtime
       String msgId = (String) map.get ( StreamTransformationConstants.MESSAGE_ID);
       //Dynamic alert message details-Trigerred through RFC SALERT_CREATE
       String element[] = new String[9];
       String tabIndex[] = new String[9];
       String elementLength[] = new String[9];
       String type[] = new String[9];
       String value[] = new String[9];
       //Container names for alert message
       element[0] = UDFReader.getString("CONTAINER_NAME_MESSAGE_ID");
       element[1] =UDFReader.getString("CONTAINER_NAME_INTERFACE_NAME");
       element[2] =UDFReader.getString("CONTAINER_NAME_OBJECT_TYPE");
            //element[2]="SAP_MAT_NO";
       element[3] =UDFReader.getString("CONTAINER_NAME_OBJECT_TYPE"); ;
       element[4] =UDFReader.getString("CONTAINER_NAME_OBJECT_TYPE");
            //element[4]="PLANT";
       element[5] = UDFReader.getString("CONTAINER_NAME_OBJECT_VALUE");
       element[6] = UDFReader.getString("CONTAINER_NAME_OBJECT_VALUE");
       element[7] =UDFReader.getString("CONTAINER_NAME_OBJECT_VALUE");
       element[8] ="TABLE";
       trace1.addWarning("Warning: \n" + element[0]  + "\n" + element[1]  + "\n" + element[2]  + "\n" + element[3]  + "\n" + element[4]  + "\n" + element[5]  + "\n" + element[6]  + "\n" + element[7]  + "\n" + element[8]);
       //Tab index of container variables in alert message
       tabIndex[0] = "000001";
       tabIndex[1] = "000002";
       tabIndex[2] = "000003";
       tabIndex[3] = "000004";  
       tabIndex[4] = "000005";  
       tabIndex[5] = "000006";  
       tabIndex[6] = "000007";  
       tabIndex[7] = "000008";
       tabIndex[8] = "000009";
       //Length of containers
       elementLength[0] = elementLength[1] = elementLength[2] =elementLength[3] = elementLength[4] = elementLength[5] = elementLength[6] =  elementLength[7]=elementLength[8]=UDFReader.getString("CONTAINER_VALUE_LENGTH");
       //Data type of containers
       type[0] = type[1] = type[2]  = type[3] = type[4]=type[5]  = type[6]  =type[7]  ="C";
       //Values supplied to containers
       value[0] =msgId;
       value[1] =interfaceName;
       value[2] =  sourceField1;
       value[3] = UDFReader.getString("MESSAGE_SEPARATOR_HYPHEN") + sourceValue1.trim();
       value[4] = UDFReader.getString("MESSAGE_SEPARATOR_COMMA")  + sourceField2;
       value[5] = UDFReader.getString("MESSAGE_SEPARATOR_HYPHEN") + sourceValue2.trim();
       value[6] = UDFReader.getString("MESSAGE_SEPARATOR_COMMA")  + sourceField3;
       value[7] = UDFReader.getString("MESSAGE_SEPARATOR_HYPHEN") + sourceValue3.trim();
       value[8] =table;
    trace1.addWarning("Table: "+table);
       // Check error handling flag
       if(errorHandlingFlag.equalsIgnoreCase("E"))
       //Throw Error and generate alert message
       trace.addInfo(UDFReader.getString("NO_RESULT_FLAG_E_TRACE"));
    trace1.addWarning("Error Flag: E");
    for (int i=0; i<9; i++){
    trace1.addWarning("Parameters["+i+"]: " +value[i]);
       result = SUPPRESS;
       RfcAlertHandler.RFCAlert(alertCat,element,tabIndex,elementLength,type,value,trace);
       throw new ValueMappingException(UDFReader.getString("NO_RESULT_FLAG_E_EXCEPTION"));
       else if(errorHandlingFlag.equalsIgnoreCase("N"))
        //Pass 'NA' value to target
        result=UDFReader.getString("NO_RESULT_FLAG_N_VALUE_PASSED");
        trace.addInfo(UDFReader.getString("NO_RESULT_FLAG_N_TRACE"));
    trace1.addWarning("Error Flag: N");
       else if(errorHandlingFlag.equalsIgnoreCase("B"))
        //Pass blank value to target
        result="";
        trace.addInfo(UDFReader.getString("NO_RESULT_FLAG_B_TRACE"));
    trace1.addWarning("Error Flag: B");
       else
        //Incorrect Error Handling Flag
        trace.addInfo(UDFReader.getString("INCORRECT_FLAG_TRACE"));
    trace1.addWarning("Error Flag: INCORRECT");
        result = SUPPRESS;
        throw new ValueMappingException(UDFReader.getString("INCORRECT_FLAG_EXCEPTION"));
    return result;
    Can someone check where could be the problem?
    Thanks,
    Glory.

    What is RfcLookupHandler? And where is RFC channel settings?

Maybe you are looking for

  • Problem regarding the creation of sales order using bapi.

    Hai all, I am creating sales order using bapi but i am, get following error messages : TYPE ID  NUMBER MESSAGE E       VP   112       Please enter sold-to party or ship-to party E       V4   219       Sales document  was not changed I have entered al

  • Ms Access Last function equivalent function in T-SQL

    Hi, I am new to SQL Server. I have table with information below. Some provider is listed twice in the table Provider Code Outlet Code Provider Province Phone First Visit Date Last Visit Date Supervision Score (%) Score of Critical Steps IUD Percentag

  • Texting on a Pearl is worse than getting teeth pulled..

    The only way I can type a text message is to hit space after every letter then go back and delete the spaces. If I do not put the space in and continue to the next letter the BB will change the entire word. Any suggestions? Even typing "ttyl" is quie

  • Which table stores this value Transmission Servlet Base URL

    Hi All, EBS r12 12.1.3 From the screen in Payment Update Payment System: FirstDataNorth i am looking for table that stores this value Transmission Servlet Base URL did look in these tables FND_PROFILE*but not available. Please help! Regards,

  • Surcharge at the Item level in variant configuration

    Hello, I have created a pricing condition for the surcharges at the item level and i can see the surchage being added up to the total value in the sales order. But when i create a invoice the condition value for the item is not being copied into the