Problem when calling a return type BOOLEAN SQL Function in a package

Hi All,
I am having problem when trying to call a SQL function in a package with return type BOOLEAN
The SQL function signature is as follows
CREATE OR REPLACE PACKAGE RMSOWNER.ORDER_ATTRIB_SQL ****
FUNCTION GET_PO_TYPE_DESC(O_error_message IN OUT VARCHAR2,
I_PO_TYPE       IN     VARCHAR2,
O_PO_TYPE_DESC  IN OUT VARCHAR2)
RETURN BOOLEAN;
Following is my java code
+CallableStatement cs3 = conn.prepareCall("{?=call ORDER_ATTRIB_SQL.GET_PO_TYPE_DESC(?,?,?)}");+
+cs3.registerOutParameter(1, java.sql.Types.BOOLEAN);+
+cs3.registerOutParameter(2, java.sql.Types.VARCHAR);+
+cs3.registerOutParameter(4, java.sql.Types.VARCHAR);+
+cs3.setString(2, "");+
+cs3.setString(3, "ST");+
+cs3.setString(4, "");+
+ResultSet rs3 = cs3.executeQuery();+
I get the following exception, i tried changing the sql type(registerOutParameter) from boolean to bit but i still getting this exception.
But when i call any other functions with return type other than boolean they work perfectly fine.
Please can anyone help me fix this issue, i am not sure if its anything to do with vendor JDBC classes?
+java.sql.SQLException: ORA-06550: line 1, column 13:+
+PLS-00382: expression is of wrong type+
+ORA-06550: line 1, column 7:+
+PL/SQL: Statement ignored+
+     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)+
+     at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)+
+     at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)+
+     at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)+
+     at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:215)+
+     at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:954)+
+     at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1168)+
+     at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3316)+
+     at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3422)+
+     at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4394)+
#####

Hello People!
There is another workaround!!
See the example below:
private String callBooleanAPi(String tableName,String apikey,String dtInicio,String dtFim,String comando) throws SQLException {
               CallableStatement cs = null;
               String call = "";
               String retorno = null;
               try {
                    if(comando.equalsIgnoreCase("INSERT")){
                         call = "declare x BOOLEAN; y varchar2(2);begin x :=PKG.INSERT(?,?,?,?,?); if x then y := 'S'; else y :='N'; end if; ? := y;end;";
                    } else if(comando.equalsIgnoreCase("UPDATE")){
                         call = "declare x BOOLEAN; y varchar2(2);begin x := PKG.UPDATE(?,?,?,?,?); if x then y := 'S'; else y :='N'; end if; ? := y;end;";
                    } else if(comando.equalsIgnoreCase("DELETE")){
                         call = "declare x BOOLEAN; y varchar2(2);begin x := PKG.DELETE(?,?,?,?,?); if x then y := 'S'; else y :='N'; end if; ? := y;end;";
                    cs = conn.prepareCall(call);
                    SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
                    SimpleDateFormat sdfToSqlDate = new SimpleDateFormat("yyyy-MM-dd");
                    java.util.Date dataInicialVigencia =null;
                    java.util.Date dataFinalVigencia = null;
                    Date dtInicialFormatada =null;
                    Date dtFinalFormatada = null;
                    if(dtInicio != null && !dtInicio.equals("")){
                         dataInicialVigencia = sdf.parse(dtInicio);
                         dtInicio =sdfToSqlDate.format(dataInicialVigencia);
                         dtInicialFormatada = Date.valueOf(dtInicio);
                    if(dtFim != null && !dtFim.equals("")){
                         dataFinalVigencia = sdf.parse(dtFim);
                         dtFim =sdfToSqlDate.format(dataFinalVigencia);
                         dtFinalFormatada = Date.valueOf(dtFim);
                    cs.setString(1, tableName);
cs.setString(2, apikey);
cs.setDate(3, dtInicialFormatada );
cs.setDate(4, dtFinalFormatada );
cs.registerOutParameter(5, java.sql.Types.VARCHAR);
cs.registerOutParameter(6, java.sql.Types.VARCHAR );
cs.execute();
                    retorno = cs.getString(6);
                    System.out.println( cs.getString(5));
               } catch(SQLException e){
               throw new SQLException("An SQL error ocurred while calling the API COR_VIGENCIA: " + e);
               } catch(Exception e){
               Debug.logger.error( "Error calculating order: " + id, e );
               } finally {
               if (cs != null) {
               cs.close();
               cs = null;
               return retorno;
As you can see the CallableStatement class acepts PL/SQl blocks.
Best Regards.

Similar Messages

  • Specify two conditions for button type: pl/sql function body return boolean

    Hello,
    Can anyone help me out with this issue.
    I am using Oracle APEX 3.2 version.
    I have page zero select list with submit items P0_ITEM1, P0_ITEM2, P0_ITEM3
    and i also have a button on page zero. Now I want to make this button conditional
    like only show the button only when all the three items are selected. For this I am having the below condition which is working perfectly fine.
    Type: PL/SQL function returning boolean.
    RETURN NVL(:P0_ITEM1,'%'||'null%') != '%'||'null%' AND
    NVL(:P0_ITEM2,'%'||'null%') != '%'||'null%' AND
    NVL(:P0_ITEM3,'%'||'null%') != '%'||'null%' ;Now I want to add one more condition to the button --
    the condition is that, the buttton should be displayed only on the pages 1,2,3,4
    so can anyone please help me out how do i change the code to include the additional condition.
    thanks,
    Orton
    Edited by: orton607 on Jul 28, 2010 2:02 PM

    Try:
    Type: PL/SQL function returning boolean.
    RETURN NVL(:P0_ITEM1,'%'||'null%') != '%'||'null%' AND
    NVL(:P0_ITEM2,'%'||'null%') != '%'||'null%' AND
    NVL(:P0_ITEM3,'%'||'null%') != '%'||'null%' AND
    :app_page_id in (1, 2, 3, 4);http://download.oracle.com/docs/cd/E17556_01/doc/user.40/e15517/concept.htm#sthref156

  • 11g preview version 3: JNDI Lookup problem when calling PL/SQL webservice

    Hi,
    I am experiencing a problem when calling a PL/SQL Webservice from a BPEL flow.
    When I am trying to test my BPEL flow from the SOA Console I get a "Error doing JNDI lookup on target jdbc/MyDBDS"
    The composite application including the BPEL flow is deployed in one application. "CompositeApp" and the web service in another Application called
    "WebServiceApp".
    Both applications are deployed on the same built in OC4J Application Server
    If I test the webservice in isolation from the SOA console it works. It also seems to be working if the webservice and the and the BPEL flow is in the same project.
    If anyone has any ideas on this one I would be very greatful.
    Thanks in advance

    try creating the MyDBDS connection as an application resource in both applications.

  • Function with return type boolean

    I have created a function with return type boolean as:
    CREATE OR REPLACE FUNCTION fn RETURN BOOLEAN
    AS
    exp EXCEPTION;
    BEGIN
    return TRUE;
    EXCEPTION
    when OTHERS then RAISE exp;
    END;
    FUNCTION fn compiledThen I was trying to call this function into dbms_output.put_line procedure, I got this error:
    EXECUTE DBMS_OUTPUT.PUT_LINE(fn);
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'Can someone please help me understand, why this happened?
    Is this because of boolean return type?

    952040 wrote:
    I have created a function with return type boolean as:
    Then I was trying to call this function into dbms_output.put_line procedure, I got this error:
    EXECUTE DBMS_OUTPUT.PUT_LINE(fn);
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
    What is the parameter signature for DBMS_OUTPUT.put_line() ?
    Is is string - as detailed in Oracle® Database PL/SQL Packages and Types Reference guide.
    So how can you pass a boolean data type as parameter value, when the parameter's data type is string?
    PL/SQL supports implicit data conversion. So you can for example pass a number or date value to DBMS_OUTPUT.put_line() - and the PL/SQL engine automatically (and implicitly) converts that (using the TO_CHAR() functions) to a string.
    However, the TO_CHAR() parameter signature supports number and date - not boolean. It cannot convert a boolean value into a string.
    So passing a boolean value means the implicit conversion fails - and results in the above error.
    To make it work, you need to perform an explicit conversion. As as a data type conversion function from boolean to string is not available, you need to write a user defined function. E.g.
    SQL> create or replace function BoolToChar( b boolean ) return varchar2 is
      2  begin
      3    case
      4       when b then return( 'TRUE' );
      5       when not b then return( 'FALSE' );
      6    else
      7      return( null );
      8    end case;
      9  end;
    10  /
    Function created.
    SQL>
    SQL> exec DBMS_OUTPUT.put_line( 'Flag is '||BoolToChar(true) );
    Flag is TRUE
    PL/SQL procedure successfully completed

  • ODSI support for return type "PL/SQL TABLE"?

    Hello!
    We are trying to connect our ODSI to an Oracle function with return type "PL/SQL TABLE". The ODSI "wizard" (used to create the physical data service) seems to understand the interface during creation, but when executed it fails. The ODSI server complains about wrong type (PLS-00382: expression is of wrong type) when we execute it from the "test tab".
    The function's metadata is looks like this:
    <params xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdt="http://www.w3.org/2004/07/xpath-datatypes" xmlns:pn1="ld:physical/rekondis/CALC_DEBITING" >
    <param name="RETURN_VALUE" kind="return" xqueryType="pn1:RETURN_VALUE_ROW" nativeTypeCode="1111" nativeType="PL/SQL TABLE"/>
    <param name="PIN_CASE_ID" kind="in" xqueryType="xs:decimal" nativeTypeCode="3" nativeType="NUMBER"/>
    <param name="PIN_ACTION_CODE" kind="in" xqueryType="xs:decimal" nativeTypeCode="3" nativeType="NUMBER"/>
    <param name="PI_AD_NAME" kind="in" xqueryType="xs:string" nativeTypeCode="12" nativeType="VARCHAR2"/>
    </params>
    Any ideas how we can make this work!? Or is this not even supported in ODSI 10.3?
    Thanks!
    // Mikael

    Please refer to the documentation - http://download.oracle.com/docs/cd/E13162_01/odsi/docs10gr3/datasrvc/Create%20Physical%20Data%20Services%20from%20Stored%20Procedures.html

  • Hi.. I got some problem  when i want to type something , letters are not displaying immediately , they are displaying after some seconds. can you help me out

    Hi.. I got some problem  when i want to type something , letters are not displaying immediately , they are displaying after some seconds. can you help me out

    Hello:
    I am not being critical, but you seem to want Safari to behave exactly like Chrome.  Every software developer has a plan.  Sometimes features in one product parallel other products - sometime not.  There might be some things available that would help you.  Do not hold your breath, however, for suggestions from people who use these forums.  Most of us use (and like) Apple products.  If you wish to make suggestions for future improvements, there is a feedback area on this web site that Apple employees read/review.
    Candidly, your approach would be akin to suggesting that Apple emulate the "features" in Windows (heaven forbid).
    I use Safari (and have for years).  I use Firefox (not a bad product) as my alternate browser.
    Sorry for what appears to be a pedantic lecture.  However, I think most of us adapt to different products if we really want to use them.
    Barry
    Message was edited by: Barry Hemphill

  • [svn] 4741: Fix to RTE problem when calling captureEndValues() without having first called captureStartValues().

    Revision: 4741
    Author: [email protected]
    Date: 2009-01-29 13:43:53 -0800 (Thu, 29 Jan 2009)
    Log Message:
    Fix to RTE problem when calling captureEndValues() without having first called captureStartValues(). outcome of a patch submission, although this fix is different than the one suggested in the patch.
    QE Notes: None
    Doc Notes: None
    Bugs: patch sdk-17060, bug sdk-16452
    Reviewer: Jason
    tests: checkintests, Mustella: tests/Effects tests/ListDataEffects
    Ticket Links:
    http://bugs.adobe.com/jira/browse/sdk-17060
    http://bugs.adobe.com/jira/browse/sdk-16452
    Modified Paths:
    flex/sdk/branches/3.x/frameworks/projects/framework/src/mx/effects/Effect.as

    Look for the "contact us" on the verizon pages.  http://www22.verizon.com/content/contactus/
    Almost all of the forums here are peer to peer.  Some verizon admins will occasionaly step in and try to get you help.  These admins are usually not able to solve problems for you themselves, but can sometimes give advise or get you in contact with someone who can.

  • Problems when trying to return information for External Content Types in Sharepoint 2013

    This is my first post on the forum, until I tried on this problem but have not found anything.
    When trying to return the information from the external content displays the following error:
    Error retrieving data from mill. Administrators: query the server log for more information.
    I do not know what else to do...

    Hi,
    According to your post, my understanding is that you got an error when tried to return the information from the external content.
    Did the error occur when you created a new external content type or created a external list?
    You can check the steps with the following articles about how to create a external content type.
    http://lightningtools.com/bcs/creating-an-external-content-type-with-sharepoint-designer-2013/
    http://wyldesharepoint.blogspot.in/2012/12/sharepoint-2013-setting-up-external.html
    If the error occurred with the external list, you can check the steps with the following article.
    http://community.bamboosolutions.com/blogs/sharepoint-2013/archive/2013/01/08/how-to-create-external-data-column-in-sharepoint-2013.aspx
    You can also check the event log and ULS log to see if anything unexpected occurred.
    For SharePoint 2013, by default, ULS log is at      
    C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\LOGS
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Problem when summery the data type of interval day to second

    hi
    i write a program calculate periods of time and summary it then i used interval day to second data type
    oracle support basic 4 math operation (+,-,*,/) on interval
    but although oracle does not support summary function like sum() ,avg(),count()!! this is a problem here
    the walkaround it by use oracle data cartdrage advanced future like follows steps :
    *1- i create type and i call it for ex: DAY_TO_SECOND_SUM_TYPE*
    CREATE OR REPLACE  DAY_TO_SECOND_SUM_TYPE    /*TYPE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        as object
    +(TOTAL INTERVAL day to SECOND , /* type header*/+
    STATIC FUNCTION ODCIAggregateInitialize(SCTX IN OUT DAY_TO_SECOND_SUM_TYPE) return number,
    member function ODCIAggregateIterate( self in out DAY_TO_SECOND_SUM_TYPE,value in interval  day to second) return number,
    member function ODCIAggregateTerminate(self in DAY_TO_SECOND_SUM_TYPE,returnvalue out interval day to second , flags in number) return number,
    member function ODCIAggregateMerge(self in out DAY_TO_SECOND_SUM_TYPE,ctx2 in DAY_TO_SECOND_SUM_TYPE) return number
    +)+
    +/+
    CREATE OR REPLACE TYPE "DAY_TO_SECOND_SUM_TYPE"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            as object
    +(TOTAL INTERVAL day to SECOND ,+
    STATIC FUNCTION ODCIAggregateInitialize(SCTX IN OUT DAY_TO_SECOND_SUM_TYPE) return number,
    member function ODCIAggregateIterate( self in out DAY_TO_SECOND_SUM_TYPE,value in interval  day to second) return number,
    member function ODCIAggregateTerminate(self in DAY_TO_SECOND_SUM_TYPE,returnvalue out interval day to second , flags in number) return number,
    member function ODCIAggregateMerge(self in out DAY_TO_SECOND_SUM_TYPE,ctx2 in DAY_TO_SECOND_SUM_TYPE) return number
    +)+
    create or replace type body DAY_TO_SECOND_SUM_TYPE as /* type body*/
    static function ODCIAggregateInitialize(sctx in out DAY_TO_SECOND_SUM_TYPE) return number is
    begin
    sctx := DAY_TO_SECOND_SUM_TYPE(numtodsinterval(0,'second'));
    return odciconst.Success;
    end;
    member function ODCIAggregateIterate( self in out DAY_TO_SECOND_SUM_TYPE,value in interval  day to second) return number is
    begin
    self.total := self.total value;+
    return odciconst.Success;
    end ;
    member function ODCIAggregateTerminate(self in DAY_TO_SECOND_SUM_TYPE,returnvalue out interval day to second , flags in number) return number is
    begin
    returnvalue := self.total;
    return odciconst.Success;
    end;
    member function ODCIAggregateMerge(self in out DAY_TO_SECOND_SUM_TYPE,ctx2 in DAY_TO_SECOND_SUM_TYPE) return number is
    begin
    self.total := self.total ctx2.total;+
    return odciconst.Success;
    end;
    end;
    +/+
    *2- i create artificial function to summary using that type let as called for ex: ds_sum as follows :*
    create or replace function ds_sum( input interval day to second   ) return interval day to second
    parallel_enable aggregate
    using DAY_TO_SECOND_SUM_TYPE
    +/+
    at last i used the function to summary intervals and its work so good but when the result of calculated summary value exceed the default precision of interval : INTERVAL DAY(2) TO SECOND(6)
    i get an error :
    ORA-01873 the leading precision of the interval is too small
    Cause: The leading precision of the interval is too small to store the specified
    interval .
    Action: Increase the leading precision of the interval or specify an interval with
    a smaller leading precision
    although i can determine the precision of interval the declaration of the new type to maximum like :
    +...........+
    CREATE OR REPLACE TYPE "DAY_TO_SECOND_SUM_TYPE"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            as object
    +(TOTAL INTERVAL day(9) to SECOND(6) ...........+
    +.......................+
    but the problem remain (in fact the error move from one functions of type to another function )
    due i can't determine the precision of data type when i define function in PL/SQL it is illegal*
    HOW CAN I SOLVE THIS PROBLEM AND BE ABLE TO SUMMARY INTERVAL DATA TYPE WHAT EVER THE RESULT OF SUMMARY IS HUGE
    Edited by: user1193723 on Jun 18, 2009 4:35 AM
    Edited by: user1193723 on Jun 18, 2009 4:36 AM
    Edited by: user1193723 on Jun 18, 2009 4:37 AM
    Edited by: user1193723 on Jun 18, 2009 4:38 AM
    Edited by: user1193723 on Jun 18, 2009 4:38 AM
    Edited by: user1193723 on Jun 18, 2009 4:40 AM

    hi,
    Instead of 'interval day to second' in method declaration use internal datatype 'DSINTERVAL_UNCONSTRAINED'.
    There are more unconstrained types in oracle.
    Bartek

  • Return type Boolean From Oracle Function

    1. How do I get a return type of Boolean from Oracle function in Java?
    2. I have a function fx overloaded in Oracle (8 variances) and I have trouble getting the right one in Java. Is 8 too high a figure or Java does not support calling overloaded functions or what?
    Thanks for any help.

    I am facing a similar situation, where I have defined an overloaded function in one package (2 variants) which both return a type BOOLAN value.
    I am having trouble to setting up an CallableStatemnt to call one of this functions from Java. Whenever I set the parameter with a BIT or NUMBER data type, I get an exception with java.lang.boolean during my
    callablestatement.setobject( indez, parameter, OracleTypes.BIT );
    or
    callablestatement.setobject( indez, parameter, OracleTypes.NUMBER );
    I have no problem calling the function from SQLPlus, but doing so from Java raises the exception. I have found no exact match in OracleTypes or java.sql.Types for a BOOLEAN data type.
    In your response do you mean to modify the Function to return a NUMBER instead of a BOOLEAN, or do you mean to set the parameter as Types.NUMBER in the calling java code?
    Thanks,
    Fedro

  • Problem when calling a method

    hello,
    I have a problem when Im trying to call the make method that in the Tree class.
    Im calling it from the main method like you can see and It writes:
    -Cannot make a static reference to the non-static method make() from the type Tree.
    Can anyone help me please and tell me what is the problem?
    Im using Eclipse 3.1.2
    Thank you.
    //import java.lang.Object;
    //import java.lang.reflect.Array;
    //structure of the node
    class mainClass extends Tree {
         public static void main(String args[]){
              Tree.make();
              //char temporary[]=new char[9];
              //Tic_Tac_Toe pointersToNodes[]=new Tic_Tac_Toe[9];
              //for(j=0;j<9;j++)
                   //temporary[j]='b';     
    public class Tic_Tac_Toe {
         char currentCaseVector[]=new char[9];
         Tic_Tac_Toe PointersToNodes[]=new Tic_Tac_Toe[9];
         int evaluation;
    //class that builds the game tree
    class Tree {
         public Tic_Tac_Toe T1=new Tic_Tac_Toe();
         //char currentCaseVector[]=new char[9];
         public char currentSign;
         Tree(){
             resetCurrentCaseArray(T1);
             //T1.currentCaseVector.setSize(9);
              //System.out.println(T1.currentCaseVector.elementAt(2));
         void make(){
              Tic_Tac_Toe T = new Tic_Tac_Toe();
              int howMuchCloser,i;
              Tree tree=new Tree();
              for(i=0;i<9;i++)
                   T.currentCaseVector='b';
              howMuchCloser=1;
              for(i=0;i<9;i++){
                   T.PointersToNodes[findAvailablePlaceOnPointersToNodes(T)]=tree.buildNewTree(1,'o',T.currentCaseVector,howMuchCloser);
                   howMuchCloser++;
         Tic_Tac_Toe buildNewTree(int i,char currentSign,char temp[],int howMuchCloser)throws ArrayIndexOutOfBoundsException{
              int j=0;
              //int howMuchCloser=1;
              //for(j=i;j<9;j++){
              Tic_Tac_Toe T1=new Tic_Tac_Toe();
              currentSign=changeSign(currentSign);
              resetCurrentCaseArray(T1);
              //try{
              setBoard(T1.currentCaseVector,temp,howMuchCloser,currentSign);
              //catch(ArrayIndexOutOfBoundsException e){
                   //System.out.print("ArrayIndexOutOfBoundsException");
                   //System.out.println(i);          
              printTest(T1);
              temp=T1.currentCaseVector;
              howMuchCloser=1;
              if((isFull(T1.currentCaseVector))==true)
                   return T1;
              if(checkWin(T1)){
                   return T1;
              //printTest(T1);
                   //break;
              for(j=i;j<9;j++){
                   T1.PointersToNodes[findAvailablePlaceOnPointersToNodes(T1)]=buildNewTree(i+1,currentSign,temp,howMuchCloser);                              
                   howMuchCloser++;
                        //if(checkIfBlankEqualOne(T1.currentCaseVector)==false)
                   //howMuchCloser++;
                   //T1.PointersToNodes[findAvailablePlaceOnPointersToNodes(T1)]=buildNewTree(i+1,currentSign,temp);
         return T1;
         int findCloser(char charArray[],int howMuchCloser){
              int i;
              for(i=0;i<9;i++){
                   if (charArray[i]=='b'){
                        howMuchCloser--;
                   else
                        continue;
                   if (howMuchCloser==0)
                        break;     
              return i;
         void setBoard(char current[],char previous[],int howMuchCloser,char iksOrCircle){
                   int i;
                   for(i=0;i<9;i++){
                        current[i]=previous[i];/******/
                   current[findCloser(current,howMuchCloser)]=iksOrCircle;
         char changeSign(char sign){
              if(sign=='x')
                   return 'o';
              else
                   return 'x';
         boolean isFull(char array[]){
              int i;
              for(i=0;i<9;i++){
                   if(array[i]=='b'){
                        return false;
              return true;
         void resetCurrentCaseArray(Tic_Tac_Toe T1){
              for(int i=0;i<9;i++)
                   T1.currentCaseVector[i]='b';
         boolean checkWin(Tic_Tac_Toe T1){
              int count1=0;
              int count2=0;
              //checking columns
              int i,j;
              for(i=0;i<3;i++){
                   for(j=i;j<(i+7);j+=3){
                        if(T1.currentCaseVector[j]=='x')
                             count1++;
                        if(T1.currentCaseVector[j]=='o')
                             count2++;
                   if(count1==3)
                        return true;
                   if(count2==3)
                        return true;
                   count1=0;
                   count2=0;
              //checking rows
              for(i=0;i<7;i+=3){
                   for(j=i;j<(i+3);j++){
                        if(T1.currentCaseVector[j]=='x')
                             count1++;
                        if(T1.currentCaseVector[j]=='o')
                             count2++;
                   if(count1==3)
                        return true;
                   if(count2==3)
                        return true;
                   count1=0;
                   count2=0;
              //checking diagonal
              for(i=0;i<9;i+=4){
                   if(T1.currentCaseVector[i]=='x')
                        count1++;
                   if(T1.currentCaseVector[i]=='o')
                        count2++;
              if(count1==3)
                   return true;
              if(count2==3)
                   return true;
              count1=0;
              count2=0;
              for(i=2;i<7;i+=2){
                   if(T1.currentCaseVector[i]=='x')
                        count1++;
                   if(T1.currentCaseVector[i]=='o')
                        count2++;
              if(count1==3)
                   return true;
              if(count2==3)
                   return true;
              return false;
         public int findAvailablePlaceOnPointersToNodes(Tic_Tac_Toe tic_tac_toe){
              int i;
              for(i=0;i<9;i++)
                   if(tic_tac_toe.PointersToNodes[i]==null)
                        return i;
              return -1;
         void printTest(Tic_Tac_Toe T1){
              for(int i=0;i<9;i++)
                   System.out.println(T1.currentCaseVector[i]);
         boolean checkIfBlankEqualOne(char array[]){
              for(int i=0;i<9;i++){
                   if(i<8)
                        if(array[i]=='b')
                             return false;
              if(array[8]=='b')
                   return true;
              return false;
         /*void makeFirst(char temporary[]){
              for(int i=0;i<9;i++)
                   temporary[i]='b';

    I have two things in mind:
    1. either modify the make() in class Tree as static
    static void make() {//caution u may have to worry about instance variables referenced under this method2.
    under your main static method, invoke it like this instead
    mainClass mc=new mainClass();
    mc.make();//not Tree.make();

  • JTextField update problem when called from PropertyChangeEvent

    Hi,
    I'm trying to create forms that can be dynamically loaded with Class.forname(formName).
    Those forms should always inherit some methods that make it easy to pass data to
    them and receive data from them. The idea is that the data comes from a table which
    sends a hashmap (String column/JTextField-name + String Value pairs) with firePropertyChanged
    as soon as a new row is seleceted. The JTextFields in the form are marked with setName("FieldName") that has to correspond to the name of the columns of the table.
    My problem is that I can't update the fields in my form when I'm calling getRow(HashMap)
    from within propertyChangeEvent but that's necessary to keep the forms flexible.
    JTextFieldName.setText(newText) just won't work. But it works when I call getRow(HashMap)
    from the constructor. SwingWorker and threads to update the form didn't help.
    I don't need to call pack() / update() / repaint() on the JFrame, do I ??
    update() / validate() / repaint() etc. didn't work on the JTextField themselves.
    Below is the code for one of the test-forms (just a JPanel that is inserted in a frame)
    with all of it's methods. Does anybody have a solution to this problem ??
    Thanks for taking time for that !!
    Benjamin
    * testTable.java
    * Created on 15. April 2004, 16:12
    package viewcontrol.GUI;
    * @author gerbarmb
    import javax.swing.*;
    import java.awt.*;
    import java.beans.*;
    import java.util.*;
    public class testTable extends javax.swing.JPanel
              implements
                   java.awt.event.KeyListener,
                   java.beans.PropertyChangeListener {
          * public static void main(String[] argv) { testTable tt = new testTable();
          * JFrame jf = new JFrame(); jf.setContentPane(tt); jf.setVisible(true); }
         /** Creates new customizer testTable */
         public testTable() {
              initComponents();
              HashMap hm = new HashMap();
               * Only for debugging, to see that the method getRow() works when
               * called from the constructor.
               hm.put("ttext", "TEst");
               this.getRow(hm);
          * This method is called from within the constructor to initialize the form.
          * WARNING: Do NOT modify this code. The content of this method is always
          * regenerated by the FormEditor.
         private void initComponents() {//GEN-BEGIN:initComponents
              java.awt.GridBagConstraints gridBagConstraints;
              jLabel1 = new javax.swing.JLabel();
              textIn = new javax.swing.JTextField();
              jLabel2 = new javax.swing.JLabel();
              intIn = new javax.swing.JTextField();
              jLabel3 = new javax.swing.JLabel();
              numIn = new javax.swing.JTextField();
              jLabel4 = new javax.swing.JLabel();
              dateIn = new javax.swing.JTextField();
              jLabel5 = new javax.swing.JLabel();
              dateTimeIn = new javax.swing.JTextField();
              jLabel6 = new javax.swing.JLabel();
              jCheckBox1 = new javax.swing.JCheckBox();
              keepValues = new javax.swing.JCheckBox();
              jButton1 = new javax.swing.JButton();
              setLayout(new java.awt.GridBagLayout());
              jLabel1.setText("Text");
              add(jLabel1, new java.awt.GridBagConstraints());
              textIn.setName("ttext");
              textIn.setPreferredSize(new java.awt.Dimension(100, 21));
              textIn.addActionListener(new java.awt.event.ActionListener() {
                   public void actionPerformed(java.awt.event.ActionEvent evt) {
                        textInActionPerformed(evt);
              gridBagConstraints = new java.awt.GridBagConstraints();
              gridBagConstraints.gridwidth = 2;
              add(textIn, gridBagConstraints);
              jLabel2.setText("Integer");
              add(jLabel2, new java.awt.GridBagConstraints());
              intIn.setName("tint");
              intIn.setPreferredSize(new java.awt.Dimension(50, 21));
              add(intIn, new java.awt.GridBagConstraints());
              jLabel3.setText("Number");
              add(jLabel3, new java.awt.GridBagConstraints());
              numIn.setName("tnum");
              numIn.setPreferredSize(new java.awt.Dimension(50, 21));
              add(numIn, new java.awt.GridBagConstraints());
              jLabel4.setText("Date");
              gridBagConstraints = new java.awt.GridBagConstraints();
              gridBagConstraints.gridx = 0;
              gridBagConstraints.gridy = 1;
              add(jLabel4, gridBagConstraints);
              dateIn.setName("tdate");
              dateIn.setPreferredSize(new java.awt.Dimension(50, 21));
              gridBagConstraints = new java.awt.GridBagConstraints();
              gridBagConstraints.gridx = 1;
              gridBagConstraints.gridy = 1;
              add(dateIn, gridBagConstraints);
              jLabel5.setText("DateTime");
              gridBagConstraints = new java.awt.GridBagConstraints();
              gridBagConstraints.gridx = 2;
              gridBagConstraints.gridy = 1;
              add(jLabel5, gridBagConstraints);
              dateTimeIn.setName("tidate");
              dateTimeIn.setPreferredSize(new java.awt.Dimension(80, 21));
              gridBagConstraints = new java.awt.GridBagConstraints();
              gridBagConstraints.gridy = 1;
              add(dateTimeIn, gridBagConstraints);
              jLabel6.setText("Bit");
              gridBagConstraints = new java.awt.GridBagConstraints();
              gridBagConstraints.gridy = 1;
              add(jLabel6, gridBagConstraints);
              jCheckBox1.setName("tbit");
              gridBagConstraints = new java.awt.GridBagConstraints();
              gridBagConstraints.gridy = 1;
              add(jCheckBox1, gridBagConstraints);
              keepValues.setText("keep values");
              gridBagConstraints = new java.awt.GridBagConstraints();
              gridBagConstraints.gridx = 7;
              gridBagConstraints.gridy = 3;
              add(keepValues, gridBagConstraints);
              jButton1.setText("Send");
              jButton1.addActionListener(new java.awt.event.ActionListener() {
                   public void actionPerformed(java.awt.event.ActionEvent evt) {
                        jButton1ActionPerformed(evt);
              gridBagConstraints = new java.awt.GridBagConstraints();
              gridBagConstraints.gridx = 7;
              gridBagConstraints.gridy = 2;
              add(jButton1, gridBagConstraints);
         }//GEN-END:initComponents
         private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
              sendRow();
         }//GEN-LAST:event_jButton1ActionPerformed
         private boolean sendRow() {
              java.util.HashMap hm = new java.util.HashMap();
              Component[] cs = this.getComponents();
              for (int i = 0; i < cs.length; i++) {
                   if (((Component) cs).getName() != null) {
                        if (cs[i] instanceof JCheckBox) {
                             String value = ((JCheckBox) cs[i]).isSelected() ? "1" : "0";
                             hm.put(cs[i].getName(), value);
                        } else if (cs[i] instanceof JCheckBox) {
                             hm.put(cs[i].getName(), ((JTextField) cs[i]).getText());
              } // end for
              firePropertyChange("rowChanged", null, hm);
              return true;
         private void getRow(java.util.HashMap hm) {
              //if (! this.keepValues.isSelected()) {
              Component[] cs = this.getComponents();
              for (int i = 0; i < cs.length; i++) {
                   if (cs[i].getName() != null && hm.containsKey(cs[i].getName())) {
                        Component component = cs[i];
                        String componentName = cs[i].getName();
                        String componentValue = (String) hm.get(component.getName());
                        if (cs[i] instanceof JTextField) {
                             // output for debugging
                             System.out.println("Setting " + cs[i].getName() + " = "
                                       + componentValue);
                             ((JTextField) component).setText(componentValue);
                        } else if (cs[i] instanceof JCheckBox) {
                             // output for debugging
                             System.out.println("JCheckBox found");
                             JCheckBox cb = (JCheckBox) component;
                             boolean selected = (componentValue == null ? false : (componentValue.equals("1")
                                       ? true
                                       : false));
                             ((JCheckBox) component).setSelected(selected);
              } // end for
              /* Uncomment this code snippet to retrieve the text that has been set
              for the components (that means JTextFields)
              This is just for debugging !
              Component[] cs = this.getComponents(); for (int i = 0; i < cs.length;
              i++) { if (cs[i].getName() != null) { if (cs[i] instanceof
              JTextField) { System.out.println("Value of " +cs[i].getName() + " = " +
              ((JTextField) cs[i]).getText()); } } } // end for
         private void textInActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_textInActionPerformed
         }//GEN-LAST:event_textInActionPerformed
         public void keyPressed(java.awt.event.KeyEvent e) {
              if (e.getKeyCode() == java.awt.event.KeyEvent.VK_ENTER) {
                   sendRow();
         public void keyReleased(java.awt.event.KeyEvent e) {
         public void keyTyped(java.awt.event.KeyEvent e) {
         public void propertyChange(java.beans.PropertyChangeEvent evt) {
              if (evt.getPropertyName().equals("newRow")) {
                   final PropertyChangeEvent finalEvt = evt;
                   Runnable makeChanges = new Runnable () {
                        public void run() {
                             getRow((java.util.HashMap) finalEvt.getNewValue());
         // Variables declaration - do not modify//GEN-BEGIN:variables
         private javax.swing.JTextField dateIn;
         private javax.swing.JTextField dateTimeIn;
         private javax.swing.JTextField intIn;
         private javax.swing.JButton jButton1;
         private javax.swing.JCheckBox jCheckBox1;
         private javax.swing.JLabel jLabel1;
         private javax.swing.JLabel jLabel2;
         private javax.swing.JLabel jLabel3;
         private javax.swing.JLabel jLabel4;
         private javax.swing.JLabel jLabel5;
         private javax.swing.JLabel jLabel6;
         private javax.swing.JCheckBox keepValues;
         private javax.swing.JTextField numIn;
         private javax.swing.JTextField textIn;
         // End of variables declaration//GEN-END:variables

    The problem of the change in the form not being comitted is that
    I forgot SwingUtilities.invokeLater(makeChanges); in the bottom
    part in public void propertyChange(java.beans.PropertyChangeEvent evt)
    after having created a new Runnable.
    Changes to the UI often have to be comitted by SwingUtitlities.invokeLater()
    though I don't know that much about Swing yet.
    Thanks to everybody who tried to solve that problem.
    Benjamin

  • Error when calling a XI-webservice from SQL-Server 2005

    Hi all,
    we have published a webservice with XI 7.0 (using the SOAP-Adapter) and try to call it from a stored procedure within SQL-Server 2005. Upon execution we receive the error
    "<SAP:Code area="MESSAGE">EMPTY_HTTP_REQUEST_RECEIVED</SAP:Code>" and
    "<SAP:Stack>Empty HTTP query received; message processing not possible  </SAP:Stack>".
    We are using the dll MSXML2.ServerXMLHTTP. The webservice is available and can be reached from other tools like SOAP-UI when using the same endpoint-URL. It is also possible to call the service from Visual-Basic using the same code.
    Does anyone has any clue about what's causing this error?
    Thanks in advance!

    It is clear that, PI service is working absolutely fine and the problem is calling it in your SP. I do not think you are calling a web service but actually sending a HTTP request to the server. An HTTP request and a SOAP call are different in terms of protocol. You would need to explore more on how to call web services from SQL SPs.. and the right place to search would be MS SQL Server Forums..!!
    VJ

  • Character conversion problems when calling FM via RFC from Unicode ECC 6.0?

    Hi all,
    I faced a Cyrillic character convertion problem while calling an RFC function from R/3 ECC 6.0 (initialized as Unicode system - c.p. 4103). My target system is R/3 4.6C with default c.p. 1500.
    The parameter I used in my FM interface in target system is of type CHAR10 (single-byte, obviously).
    I have defined rfc-connection (SM59) as an ABAP connection and further client/logon language/user/password are supplied.
    The problem I faced is, that Cyrillic symbols are transferred as '#' in the target system ('#' is set as default symbol in RFC-destination definition in case character convertion error is met).
    Checking convertions between c.p. 4103  and target c.p. 1500 in my source system using tools of transaction i18n shows no errors - means conversion passed O.K. It seems default character conversion executed by source system whithin the scope of RFC-destination definition is doing something wrong.
    Further, I played with MDMP & Unicode settings whithin the RFC-destination definition with no successful result - perhaps due to lack of documentation for how to set and manage these parameters.
    The question is: have someone any experience with any conversion between Unicode and non-Unicide systems via RFC-call (non-English target obligatory !!!), or can anyone share valuable information regarding this issue - what should be managed in the RFC-destination in order to get character conversion working? Is it acceptable to use any character parameter in the target function module interface at all?
    Many thanks in advance.
    Regards,
    Ivaylo Mutafchiev
    Senior SAP ABAP Consultant

    hey,
    I had a similar experience. I was interfacing between 4.6 (RFC), PI and ECC 6.0 (ABAP Proxy). When data was passed from ECC to 4.6, RFC received them incorrectly. So i had to send trimmed strings from ECC and receive them as strings in RFC (esp for CURR and QUAN fields). Also the receiver communication channel in PI (between PI and  RFC) had to be set as Non unicode. This helped a bit. But still I am getting 2 issues, truncation of values and some additional digits !! But the above changes resolved unwanted characters problem like "<" and "#". You can find a related post in my id. Hope this info helps..

  • Security Problem when call EJB in servlet:[Security:090398]Invalid Subject

    Hi guys,
    I have several years experience with Java and EJB developing,but still I cann't explain this problem although I already knew the fix...
    Please,can anyone help me to explain why? Thanks very much!
    Ok,the problem is when I call a remote EJB in one method ,that is everything about EJB is in one method,then everything is ok.But when I just return the
    *remote service object from an helper class's static method, and call the service in servlet ,then I get java.lang.SecurityException: [Security:090398]Invalid Subject: principals=[sundan076],which sundan076 is username login into the web application.*
    The right way, call method directCall(param) ; The wrong way, call  method staticToolCall(final Map param) .
    public class EJBServletClient extends HttpServlet
         protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              this.doPost(request, response);
         protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,
                   IOException
              try
                   Map<String, String> param = new HashMap<String, String>();
                   param.put("CTS_CUSTOMER_ID", request.getParameter("CTS_CUSTOMER_ID"));
                   param.put("CTS_TASK_ID", request.getParameter("CTS_TASK_ID"));
                   param.put("SERIALNO", request.getParameter("SERIALNO"));
                   param.put("CUSTOMER_SERVICE_UM", request.getParameter("CUSTOMER_SERVICE_UM"));
                   Map result = this.directCall(param);
                   System.out.println(result);
              } catch (Exception e)
                   e.printStackTrace();
                   throw new ServletException(e);
         private Map directCall(Map param) throws Exception
              Context context = null;
              try
                   Properties p = new Properties();
                   p.put(Context.PROVIDER_URL, "t3://10.25.32.13:31256");
                   p.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
                   p.put(Context.SECURITY_PRINCIPAL, "username");
                   p.put(Context.SECURITY_CREDENTIALS, "password");
                   context = new InitialContext(p);
                   BizApplyServiceHome home = (BizApplyServiceHome) PortableRemoteObject.narrow(
                             context.lookup("ejb/rcs-css/BizApplyService"), BizApplyServiceHome.class);
                   BizApplyService bizApplyService = home.create();
                   return bizApplyService.modifyApplyCustomerInfo(param);
              } finally
                   if (context != null)
                        context.close();
         private Map staticToolCall(final Map param) throws Exception
              BizApplyService bizApplyService = EJBTool.getBizApplyService();
              return bizApplyService.modifyApplyCustomerInfo(param);
    public class EJBTool
         public static BizApplyService getBizApplyService() throws Exception
              Context context = null;
              try
                   Properties p = new Properties();
                   p.put(Context.PROVIDER_URL, "t3://10.25.32.13:31256");
                   p.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
                   p.put(Context.SECURITY_PRINCIPAL, "username");
                   p.put(Context.SECURITY_CREDENTIALS, "password");
                   context = new InitialContext(p);
                   BizApplyServiceHome home = (BizApplyServiceHome) PortableRemoteObject.narrow(
                             context.lookup("ejb/rcs-css/BizApplyService"), BizApplyServiceHome.class);
                   return home.create();
              } finally
                   if (context != null)
                        context.close();
    java.lang.SecurityException: [Security:090398]Invalid Subject: principals=[sundan076]
         at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:234)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:348)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
         at com.pingan.rcs.css.biz.service.remote.ejb.bizApplyService_u7jjbk_EOImpl_1032_WLStub.modifyApplyCustomerInfo(Unknown Source)
         at com.pingan.pafax.web.EJBServletClient.staticToolCall(EJBServletClient.java:80)
         at com.pingan.pafax.web.EJBServletClient.doPost(EJBServletClient.java:43)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3594)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: java.lang.SecurityException: [Security:090398]Invalid Subject: principals=[sundan076]
         at weblogic.security.service.SecurityServiceManager.seal(SecurityServiceManager.java:835)
         at weblogic.security.service.SecurityServiceManager.getSealedSubjectFromWire(SecurityServiceManager.java:524)
         at weblogic.rjvm.MsgAbbrevInputStream.getSubject(MsgAbbrevInputStream.java:315)
         at weblogic.rmi.internal.BasicServerRef.acceptRequest(BasicServerRef.java:875)
         at weblogic.rmi.internal.BasicServerRef.dispatch(BasicServerRef.java:310)
         at weblogic.rmi.cluster.ClusterableServerRef.dispatch(ClusterableServerRef.java:242)
         at weblogic.rjvm.RJVMImpl.dispatchRequest(RJVMImpl.java:1138)
         at weblogic.rjvm.RJVMImpl.dispatch(RJVMImpl.java:1020)
         at weblogic.rjvm.ConnectionManagerServer.handleRJVM(ConnectionManagerServer.java:240)
         at weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:882)
         at weblogic.rjvm.MsgAbbrevJVMConnection.dispatch(MsgAbbrevJVMConnection.java:453)
         at weblogic.rjvm.t3.MuxableSocketT3.dispatch(MuxableSocketT3.java:322)
         at weblogic.socket.BaseAbstractMuxableSocket.dispatch(BaseAbstractMuxableSocket.java:298)
         at weblogic.socket.SocketMuxer.readReadySocketOnce(SocketMuxer.java:915)
         at weblogic.socket.SocketMuxer.readReadySocket(SocketMuxer.java:854)
         at weblogic.socket.EPollSocketMuxer.dataReceived(EPollSocketMuxer.java:215)
         at weblogic.socket.EPollSocketMuxer.processSockets(EPollSocketMuxer.java:177)
         at weblogic.socket.SocketReaderRequest.run(SocketReaderRequest.java:29)
         at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:42)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:117)
    Edited by: 993478 on 2013-3-12 下午8:40

    I tried your way,it works! Still ,does anyone know why staticToolCall() raised exception?
    By the way,here is the code as you suggested:
    public class EJBServletClient extends HttpServlet
         protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,
                   IOException
              Context context = null;
              try
                   Map<String, String> param = new HashMap<String, String>();
                   param.put("CTS_CUSTOMER_ID", request.getParameter("CTS_CUSTOMER_ID"));
                   param.put("CTS_TASK_ID", request.getParameter("CTS_TASK_ID"));
                   param.put("SERIALNO", request.getParameter("SERIALNO"));
                   param.put("CUSTOMER_SERVICE_UM", request.getParameter("CUSTOMER_SERVICE_UM"));
                   //Map result = this.staticToolCall(param);
                   Properties p = new Properties();
                   p.put(Context.PROVIDER_URL, "t3://10.25.32.13:31256");
                   p.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
                   p.put(Context.SECURITY_PRINCIPAL, "username");
                   p.put(Context.SECURITY_CREDENTIALS, "password");
                   context = new InitialContext(p);
                   Map result=EJBTool.modifyApplyCustomerInfo(context, param);
                   System.out.println(result);
              } catch (Exception e)
                   e.printStackTrace();
                   throw new ServletException(e);
              }finally
                   if (context != null)
                        try{context.close();} catch (NamingException e){e.printStackTrace();}
    public class EJBTool
         public static Map modifyApplyCustomerInfo(Context context, Map param) throws Exception
              BizApplyServiceHome home = (BizApplyServiceHome) PortableRemoteObject.narrow(
                        context.lookup("ejb/rcs-css/BizApplyService"), BizApplyServiceHome.class);
              BizApplyService bizApplyService = home.create();
              Map result = bizApplyService.modifyApplyCustomerInfo(param);
              return result;
    }

Maybe you are looking for