Return totalRowconut and Object

hi all,
I have a bean , so in my doPost
I have List<applicationForm> allFound = new ArrayList<applicationForm>();
allFound=getStudent(conn, university_ID, currentRow);in my method I have
private  List<applicationForm> getStudent(Connection conn, String university_ID,  Integer CurrentRow)
    throws Exception {   
     try {
        conn =connectionPool.getConnection();      
          stmt = conn.createStatement(
              ResultSet.TYPE_SCROLL_INSENSITIVE,
              ResultSet.CONCUR_READ_ONLY);
         totalFamilyIncome="";
String  Sql="SELECT * FROM student as s, student_financial_info as f where s.student_id=f.student_id and   s.student_id='"+university_ID+ "'";
          rs = stmt.executeQuery(Sql);              
    connectionPool.returnConnection(conn);  
    allFound.clear(); //clean the session
    rowCount=0;
    while(rs.next()){   
  applicationForm myselect= new applicationForm();
  myselect.setStudent_id(rs.getInt("student_id"));
  allFound.add(myselect);
return allFound;
I want to return total rowcount out of my getStudent(conn, university_ID, currentRow);
be use late by doPost, How can i do that

No need to count rows, the container List<applicationForm> comes with a function called size() that returns how many rows it contains.
Example:
List<applicationForm> x1 = getStudent(conn, university_ID, CurrentRow);
System.out.println("number of rows"+x1.size());
Additional Minor point:
You dont need to put single quotes around university_ID if its an integer. You do if its a string.
s.student_id='"+university_ID+ "'"

Similar Messages

  • Get textFrame by label returns null and anchored objects

    I have the following two functions:
    function getByLabel(page, label)
        for(var i=0; i < page.allPageItems.length; i++)
            if( page.allPageItems[i].label == label )
                return page.allPageItems[i];
    and
    Object.prototype.findItems = function(/*obj*/props)
        if( !('everyItem' in this) )
            throw new Error("Error: " + this + " is not a collection.");
        var ret = this.everyItem().getElements(),
            i = ret.length,
            e, p;
        while( i-- && e=ret[i] )
            for( p in props )
                if( (p in e) && e[p]===props[p] ) continue;
                ret.splice(i,1);
        return ret;
    In my page structure, I got one main text frame (the content area) and two vertical text fromes on the sides of the page. There is also a small box textframe on top of the page. All these textboxes EXCEPT the main text frame are ALL "ANCHORED objects". I had to make them anchored objects, eitherwise after importing data, the boxes would jump around. (Example, the small box textframe that is on the top would get moved to the content area textframe etc). Not sure if using anchored objects is the proper way to fix this.
    When I try to get the small box text frame, it does not work using the findItems (returns null) but it works fine with the getByLabel method. Why is that?
    The calling syntax is:
    for( i=0 ; i < doc.pages.length ; ++i )
            var page = doc.pages.item(i);
            var textFrame = getByLabel(page, 'lblSection' ); //This works
            //   var textFrame = page.textFrames.findItems({ label:  'lblSection' })[0]; This does not work, returns null
            if( textFrame != null )
                textFrame.parentStory.contents = "";

    (function () {
        // Per the InDesign Scripting Guide, app.activeScript is only
        // valid when a script is directly executed from InDesign, not
        // from the ESTK, so a try/catch block is recommended to handle
        // it.
        var d;
        try {
            d = app.activeScript.parent.parent.fsName;
        } catch (e) {
            d = Folder.appPackage.parent.fsName+"/Scripts";
            return d;

  • Communication between javascript and Objective-c in iOS.

    We wanted to have a communication between javascript and objective c code. We have already tried the below approach.
    To load fake URLs in JS and append a string which will be used as parameter to the Objective-C code and parse that URL in this delegate method:
    -(BOOL)webView(UIWebView *)webView shouldStartLoadWithRequest(NSURLRequest *)request navigationType(UIWebViewNavigationType)navigationType
    Then send the return value by calling the native method stringByEvaluatingJavaScriptFromString again with parameter callID.
    But we wanted to access Objective class object in Javascript code so that we can call it's methods from javascript code using this object.Android supports this behaviour using addJavaScriptInterface method in webview. Is it possible to have the similar approach in IOS? If not what is the best approach possible to acheive this? If we could achieve similar behaviour then we don't need to change the Jacascript code and will be reused. Please suggest the best possible solution.
    Regards,
    Karthik M.

    https://developer.apple.com/library/mac/documentation/AppleApplications/Conceptu al/SafariJSProgTopics/Tasks/ObjCFromJavaScript.html

  • BAPI_SALESORDER_CREATEFROMDAT2 for Return Orders and Credit Orders

    Dear experts,
    I've been searching the SDN forums for information about the usage of BAPIs to create Sales Orders, Return Orders and Credit Memos. Unfortunately it seems hard to get consistent answers around the usage of BAPI_SALESORDER_CREATEFROMDAT2.
    Is it, or is it not possible, to use BAPI_SALESORDER_CREATEFROMDAT2 to create Return Orders and Credit Memos with reference to other documents? Can someone please let me know if they have successfully implemented this scenario?
    Many thanks and best regards,
    Anna Englund

    When you see the Code inside the BAPI BAPI_SALESORDER_CREATEFROMDAT2
    CALL FUNCTION 'SD_SALESDOCUMENT_CREATE'
           EXPORTING
                SALESDOCUMENT           = salesdocumentin
                SALES_HEADER_IN         = ORDER_HEADER_IN
                SALES_HEADER_INX        = ORDER_HEADER_INX
                SENDER                  = SENDER
                BINARY_RELATIONSHIPTYPE = BINARY_RELATIONSHIPTYPE
                INT_NUMBER_ASSIGNMENT   = INT_NUMBER_ASSIGNMENT
                BEHAVE_WHEN_ERROR       = BEHAVE_WHEN_ERROR
                LOGIC_SWITCH            = LOGIC_SWITCH
                BUSINESS_OBJECT         = *'BUS2032'*
    see it is only used for Sales Order(since BUS2032 is for sales order).
    you need to create or copy the BAPI BAPI_SALESORDER_CREATEFROMDAT2  to custom Function.
    then change the Business Object to BUS2094 (it is for Credit memo) . Reference i tried it didn't work that time. you check it once  with the new Custom FM.

  • How to Include Warnings/Error messages in Return Service Data Object

    Hello All,
    I am using Jdeveloper 11.1.1.3.0, ADF BC. and want to publish Service-Enabled application modules, specifically I want to publish a custome method in the application module as a web service.
    While going through Enable support for Service Interface wizard as explained in developer guide, in step 7 I read this
    >
    7. To expose service information messages such as warnings and exceptions for a custom method or warnings for process operation methods, select Include Warnings in Return Service Data Object. For example, you might want display an informational message when a method returns the total employee compensation and the total is outside of the desired range.
    If Include Warnings is not selected, no informational messages will be returned with the service response. This option is only enabled when the method does not return a view row or a list
    of view rows. When the method returns view rows, the underlying view object determines whether the method supports warnings, as described Section 11.2.4, "How to Service-Enable Individual View Objects." The informational messages (and warnings) are reported as part of the return object. JDeveloper generates appropriate wrappers as the return objects, and the wrappers contain the actual method return and the informational messages.
    >
    I am interested in this part: For example, you might want display an informational message when a method returns the total employee compensation and the total is outside of the desired range.
    To do this, I write a method in the application module
    public Number getEmpSal(Number empId){
            EmployeesViewImpl employeesView1 = this.getEmployeesView1();
            //this is the bind variable setter
            employeesView1.setEmpId(empId);
            employeesView1.executeQuery();
            EmployeesViewRowImpl first = (EmployeesViewRowImpl)employeesView1.first();
           return first!=null ? first.getSalary() : null;
    }and I selected the Include Warnings in Return Service Data Object check box. but how and where can I expose the error or warning message?
    Note:
    I tried to throw an exception in the method
    public Number getEmpSal(Number empId){
            EmployeesViewImpl employeesView1 = this.getEmployeesView1();
            //this is the bind variable setter
            employeesView1.setEmpId(empId);
            employeesView1.executeQuery();
            EmployeesViewRowImpl first = (EmployeesViewRowImpl)employeesView1.first();
            if(first!=null && (first.getSalary()!=null || first.getSalary().compareTo(1000)==1))
                throw new JboException("out of range salary");
             return first!=null ? first.getSalary() : null;
    }and when I test the web service for some employee I get this response:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <env:Header/>
         <env:Body>
              <env:Fault>
                   <faultcode>env:Server</faultcode>
                   <faultstring>out of range salary</faultstring>
                   <detail><tns:ServiceErrorMessage xmlns:tns="http://xmlns.oracle.com/adf/svc/errors/" xmlns:xsi=      "http://www.w3.org/2001/XMLSchema-instance"><tns:code/><tns:message>out of range  salary</tns:message><tns:severity>SEVERITY_ERROR</tns:severity><tns:exceptionClassName>oracle.jbo.JboException</tns:exceptionClassName></tns:ServiceErrorMessage>
                   </detail>
              </env:Fault>
         </env:Body>
    </env:Envelope>but is this the right approach or there is another place to show error/warning messages?
    Edited by: Mohammad Jabr on Apr 16, 2012 1:17 PM

    This is fine if you raise exception from your code. It will be raised as a server fault only.

  • Java.util.Calendar returning wrong Date object

    Example: This was my scenario last night. A server in California has date/time of 'Mon Aug 18'. Current time in Indiana is 'Sun Aug 17'. I use Calendar.getInstance(TimeZone.getTimeZone("America/Indiana/Indianapolis")) to return a Calendar instance. I then call the getTime() method on that instance. It should return a Date object relating to that particular time zone. It will not. It defaults back to the server time. When I print out the Calendar instance everything is good, correct date, correct time,etc. WHY WON'T THE getTime() return the correct java.util.Date???
    Following is the output was run today so the dates happened to be the same so focus on the Time. Output includes Server time, new Calendar values, and the Date returned by calendar instance getTime(). See that the Calendar is getting the correct Time.
    SERVER DATE=Mon Aug 18 15:52:13 CEST 2003
    CALENDAR INSTANCE=java.util.GregorianCalendar[time=1061214732975,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="America/Indiana/Indianapolis",offset=-18000000,dstSavings=0,useDaylight=false,transitions=35,lastRule=null],firstDayOfWeek=2,minimalDaysInFirstWeek=1,ERA=1,YEAR=2003,MONTH=7,WEEK_OF_YEAR=34,WEEK_OF_MONTH=4,DAY_OF_MONTH=18,DAY_OF_YEAR=230,DAY_OF_WEEK=2,DAY_OF_WEEK_IN_MONTH=3,AM_PM=0,HOUR=8,HOUR_OF_DAY=8,MINUTE=52,SECOND=12,MILLISECOND=975,ZONE_OFFSET=-18000000,DST_OFFSET=0]
    Date from getTime()=Mon Aug 18 15:52:12 CEST 2003

    I got it worked with using DateFormat.parse !
    The trick is to instantiate a new Date object as a result
    of parsing out of 'localized' date string.
    with below code :
    Calendar localCal = new GregorianCalendar(TimeZone.getTimeZone("America/Los_Angeles"));
    localCal.set(Calendar.DATE, 25);
    localCal.set(Calendar.MONTH, 7);
    localCal.set(Calendar.YEAR, 2003);
    localCal.set(Calendar.HOUR_OF_DAY,6);
    localCal.set(Calendar.MINUTE, 38);
    localCal.set(Calendar.SECOND, 11);
    Calendar sinCal = new GregorianCalendar(TimeZone.getTimeZone("Asia/Singapore"));
    sinCal.setTimeInMillis(localCal.getTimeInMillis());
    int date = sinCal.get(Calendar.DATE);
    int month = sinCal.get(Calendar.MONTH);
    int year = sinCal.get(Calendar.YEAR);
    int hour = sinCal.get(Calendar.HOUR_OF_DAY);
    int min = sinCal.get(Calendar.MINUTE);
    int sec = sinCal.get(Calendar.SECOND);
    String sinTimeString = date + "/" + month + "/" + year + " " + hour + ":" + min + ":" + sec;
    System.out.println("VIDSUtil.hostToLocalTime : time string now in SIN time : " + sinTimeString);
    java.util.Date sinTime = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").parse(sinTimeString);
    System.out.println("time in SIN using Date.toString(): " + sinTime.toString());
    It prints out :
    VIDSUtil.hostToLocalTime : time string now in SIN time : 25/7/2003 21:38:11
    time in SIN using Date.toString(): Fri Jul 25 21:38:11 PDT 2003
    (Ignore the PDT, because Date.toString() defaults where the JVM is running)

  • Invoking stored procedure that returns array(oracle object type) as output

    Hi,
    We have stored procedures which returns arrays(oracle type) as an output, can anyone shed some light on how to map those arrays using JPA annotations? I tried using jdbcTypeName but i was getting wrong type or argument error, your help is very much appreciated. Below is the code snippet.
    JPA Class:
    import java.io.Serializable;
    import java.sql.Array;
    import java.util.List;
    import javax.persistence.Entity;
    import javax.persistence.Id;
    import org.eclipse.persistence.annotations.Direction;
    import org.eclipse.persistence.annotations.NamedStoredProcedureQuery;
    import org.eclipse.persistence.annotations.StoredProcedureParameter;
    * The persistent class for the MessagePublish database table.
    @Entity
    @NamedStoredProcedureQuery(name="GetTeamMembersDetails",
         procedureName="team_emp_maintenance_pkg.get_user_team_roles",
         resultClass=TeamMembersDetails.class,
         returnsResultSet=true,
         parameters={  
         @StoredProcedureParameter(queryParameter="userId",name="I_USER_ID",direction=Direction.IN,type=Long.class),
         @StoredProcedureParameter(queryParameter="employeeId",name="I_EMPLOYEEID",direction=Direction.IN,type=Long.class),
         @StoredProcedureParameter(queryParameter="TEAMMEMBERSDETAILSOT",name="O_TEAM_ROLES",direction=Direction.OUT,jdbcTypeName="OBJ_TEAM_ROLES"),
         @StoredProcedureParameter(queryParameter="debugMode",name="I_DEBUGMODE",direction=Direction.IN,type=Long.class)
    public class TeamMembersDetails implements Serializable {
         private static final long serialVersionUID = 1L;
    @Id
         private long userId;
         private List<TeamMembersDetailsOT> teamMembersDetailsOT;
         public void setTeamMembersDetailsOT(List<TeamMembersDetailsOT> teamMembersDetailsOT) {
              this.teamMembersDetailsOT = teamMembersDetailsOT;
         public List<TeamMembersDetailsOT> getTeamMembersDetailsOT() {
              return teamMembersDetailsOT;
    Procedure
    PROCEDURE get_user_team_roles (
    i_user_id IN ue_user.user_id%TYPE
    , o_team_roles OUT OBJ_TEAM_ROLES_ARRAY
    , i_debugmode IN NUMBER :=0)
    AS
    OBJ_TEAM_ROLES_ARRAY contains create or replace TYPE OBJ_TEAM_ROLES_ARRAY AS TABLE OF OBJ_TEAM_ROLES;
    TeamMembersDetailsOT contains the same attributes defined in the OBJ_TEAM_ROLES.

    A few things.
    You are not using a JDBC Array type in your procedure, you are using a PLSQL TABLE type. An Array type would be a VARRAY in Oracle. EclipseLink supports both VARRAY and TABLE types, but TABLE types are more complex as Oracle JDBC does not support them, they must be wrapped in a corresponding VARRAY type. I assume your OBJ_TEAM_ROLES is also not an OBJECT TYPE but a PLSQL RECORD type, this has the same issue.
    Your procedure does not return a result set, so "returnsResultSet=true" should be "returnsResultSet=false".
    In general I would recommend you change your stored procedure to just return a select from a table using an OUT CURSOR, that is the easiest way to return data from an Oracle stored procedure.
    If you must use the PLSQL types, then you will need to create wrapper VARRAY and OBJECT TYPEs. In EclipseLink you must use a PLSQLStoredProcedureCall to access these using the code API, there is not annotation support. Or you could create your own wrapper stored procedure that converts the PLSQL types to OBJECT TYPEs, and call the wrapper stored procedure.
    To map to Oracle VARRAY and OBJECT TYPEs the JDBC Array and Struct types are used, these are supported using EclipseLink ObjectRelationalDataTypeDescriptor and mappings. These must be defined through the code API, as there is currently no annotation support.
    I could not find any good examples or doc on this, your best source of example is the EclipseLink test cases in SVN,
    http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/plsql/
    http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/customsqlstoredprocedures/
    James : http://www.eclipselink.org

  • Dense Rank and Object types (oracle 9i and 10g difference).

    Hi all,
    One of my queries in my procedure uses scalar subqueries and object types.
    The code works fine in 10g but not in 9i. Both Object types and Dense_rank used below are present in both 9i and 10g.
    The following is a part of a bigger query.. but this is what it comes down to when I zero in on the error.
    -- In both 9i and 10g...
    CREATE OR REPLACE TYPE t_audit_type as object(
       add_tms date,
       add_user_id varchar2(20),
       order member function match (t t_audit_type) return integer
    Type created.
    CREATE OR REPLACE TYPE BODY t_audit_type as
    order member function match   (t t_audit_type) return integer is
    begin
      if add_tms < t.add_tms then
         return -1;
      elsif add_tms > t.add_tms then
        return 1;
      else
        return 0;
      end if;
    end;
    end;
    Type body created.
    create table t ( x int, y date);
    insert into t values(1, sysdate);
    insert into t values(1, sysdate+1);
    commit;In Oracle 10g..
    select min(t_audit_type(x,y))
    keep (dense_rank first order by x) result
    from t;
    RESULT(ADD_TMS, ADD_USER_ID)
    T_AUDIT_TYPE('19-JAN-10', 'User2')In Oracle 9i....
    9i> select min(t_audit_type(x,y))
      2   keep (dense_rank first order by x) result
      3   from t;
    select min(t_audit_type(x,y))
    ERROR at line 1:
    ORA-03113: end-of-file on communication channelHave any of you seen this before..? The connection is always being terminated when I run this command.?!

    Thanks Dom for your reply.
    Here is the message I found in the trace file for the error.
    ksedmp: internal or fatal error
    ORA-07445: exception encountered: core dump [0000000100D72F84] [SIGSEGV] [Address not mapped to object] [0x000000018] [] []
    Current SQL statement for this session:
    select min(t_audit_type(x,y))
           keep(dense_rank first order by x)x
    from tI will look in metalink and see if this has been addressed before.
    Thanks...!

  • Ldapsearch returns "no such object"

    Hi, all,
    I am new to directory server. I want to write a script to create batch users using ldapmodify. I tried to use ldapsearch to list the current entries.
    ' ldapsearch -h "saowsp02" -b "cn=xxx, cn=yyy" -s sub "objectclass=*" but returns 'no such object'.
    1. where can I find out what is my baseDN? I have no problem searching the root DSE entry
    2. can I use ldapmodify to create a new user? Where should I put user password, encrypted, uncrypted?
    Thanks,
    lynne

    1. BaseDN is your search base point. For example, you have:
    o=xyz.com
    ou=People
    ou=Groups
    etc. ...
    You want to find all person objects.
    In that case your BaseDN would be
    "ou=People,o=xyz.com"
    2. Yes, you can. You can do almost all operations via ldapmodify.
    http://docs.sun.com/source/816-6678-10/ldif.htm
    You can enter new values to the STDIN or (its more convenient)
    you can create ldif file with all necessary attributes and values.

  • Handling the return values and passing values to a dialog

    Dear all,
    I am trying to return values from a dialog to a page.
    I am following a tutorial:
    http://www.oracle.com/technology/products/jdev/101/howtos/adfdialog/index.html
    its okey, but I couldnt understand the following code:
    public void handleReturn(ReturnEvent event)
    if (event.getReturnValue() != null)
    Customer cst;
    String name;
    String psw;
    cst = (Customer)event.getReturnValue();
    CustomerList.getCustomers().add(cst);
    name = cst.getFirstName();
    psw = cst.getPassword();
    inputText1.setSubmittedValue(null);
    inputText1.setValue(name);
    inputText2.setSubmittedValue(null);
    inputText2.setValue(psw);
    please help me what are these variables?
    that I could be able to map with me own.
    Regards:
    Muhammad Nadeem
    [email protected]

    If you look further down on the tutorial, you will notice that these values are set in the dialog done() and cancel() actionListeners. Similarly, you will return your own object(s) when calling returnFromProcess() - see the done() method.
    Regards,
    Nick

  • Client/server RMI app using Command pattern: return values and exceptions

    I'm developing a client/server java app via RMI. Actually I'm using the cajo framework overtop RMI (any cajo devs/users here?). Anyways, there is a lot of functionality the server needs to expose, all of which is split and encapsulated in manager-type classes that the server has access to. I get the feeling though that bad things will happen to me in my sleep if I just expose instances of the managers, and I really don't like the idea of writing 24682763845 methods that the server needs to individually expose, so instead I'm using the Command pattern (writing 24682763845 individual MyCommand classes is only slightly better). I haven't used the command pattern since school, so maybe I'm missing something, but I'm finding it to be messy. Here's the setup: I've got a public abstract Command which holds information about which user is attempting to execute the command, and when, and lots of public MyCommands extending Command, each with a mandatory execute() method which does the actual dirty work of talking to the model-functionality managers. The server has a command invoker executeCommand(Command cmd) which checks the authenticity of the user prior to executing the command.
    What I'm interested in is return values and exceptions. I'm not sure if these things really fit in with a true command pattern in general, but it sure would be nice to have return values and exceptions, even if only for the sake of error detection.
    First, return values. I'd like each Command to return a result, even if it's just boolean true if nothing went wrong, so in my Command class I have a private Object result with a protected setter, public getter. The idea is, in the execute() method, after doing what needs to be done, setResult(someResult) is called. The invoker on the server, after running acommand.execute() eventually returns acommand.getResult(), which of course is casted by the client into whatever it should be. I don't see a way to do this using generics though, because I don't see a way to have the invoker's return value as anything other than Object. Suggestions? All this means is, if the client were sending a GetUserCommand cmd I'd have to cast like User user = (User)server.executeCommand(cmd), or sending an AssignWidgetToGroup cmd I'd have to cast like Boolean result = (Boolean)server.executeCommand(cmd). I guess that's not too bad, but can this be done better?
    Second, exceptions. I can have the Command's execute() method throw Exception, and the server's invoker method can in turn throw that Exception. Problem is, with a try/catch on the client side, using RMI (or is this just a product of cajo?) ensures that any exception thrown by a remote method will come back as a java.lang.reflect.InvocationTargetException. So for example, if in MyCommand.execute() I throw new MySpecialException, the server's command invoker method will in turn throw the same exception, however the try/catch on the client side will catch InvocationTargetException e. If I do e.getCause().printStackTrace(), THERE be my precious MySpecialException. But how do I catch it? Can it be caught? Nested try/catch won't work, because I can't re-throw the cause of the original exception. For now, instead of throwing exceptions the server is simply returning null if things don't go as planned, meaning on the client side I would do something like if ((result = server.executeCommand(cmd)) == null) { /* deal with it */ } else { /* process result, continue normally */ }.
    So using the command pattern, although doing neat things for me like centralizing access to the server via one command-invoking method which avoids exposing a billion others, and making it easy to log who's running what and when, causes me null-checks, casting, and no obvious way of error-catching. I'd be grateful if anyone can share their thoughts/experiences on what I'm trying to do. I'll post some of my code tomorrow to give things more tangible perspective.

    First of all, thanks for taking the time to read, I know it's long.
    Secondly, pardon me, but I don't see how you've understood that I wasn't going to or didn't want to use exceptions, considering half my post is regarding how I can use exceptions in my situation. My love for exception handling transcends time and space, I assure you, that's why I made this thread.
    Also, you've essentially told me "use exceptions", "use exceptions", and "you can't really use exceptions". Having a nested try/catch anytime I want to catch the real exception does indeed sound terribly weak. Just so I'm on the same page though, how can I catch an exception, and throw the cause?
    try {
    catch (Exception e) {
         Throwable t = e.getCause();
         // now what?
    }Actually, nested try/catches everywhere is not happening, which means I'm probably going to ditch cajo unless there's some way to really throw the proper exception. I must say however that cajo has done everything I've needed up until now.
    Anyways, what I'd like to know is...what's really The Right Way (tm) of putting together this kind of client/server app? I've been thinking that perhaps RMI is not the way to go, and I'm wondering if I should be looking into more of a cross-language RPC solution. I definitely do want to neatly decouple the client from server, and the command pattern did seem to do that, but maybe it's not the best solution.
    Thanks again for your response, ejp, and as always any comments and/or suggestions would be greatly appreciated.

  • Returning Non Serializable Objects

    Is it possible in anyway to return non serializable objects from the remote method of an EJB, for instance return a result set. Everytime i try, i get a CORBA marshalling exception, i tried to put the resultset in a serilized object such as an enumeration or vector but got the same error when retreiving it from the enumeration or vector. Help is needed and appreciated. Thanx.

    Is it possible in anyway to return non serializable objects from the remote method of an EJB, for instance return a result set. Everytime i try, i get a CORBA marshalling exception, i tried to put the resultset in a serilized object such as an enumeration or vector but got the same error when retreiving it from the enumeration or vector. Help is needed and appreciated. Thanx.

  • How comples return types and parameters are mapped

    Hi all!
    I want to know how complex return types and parameters in a java interface gets mapped to wsdl? for example how would the wsdl for the following interface shall look like:
    interface ComplexReturns{
       java.util.Date getLuckyDate(java.util.Date DoB);
       myPack.MyClass getMyClass();
    }

    Hi,
    - In your application module, make a public method that returns an arry, for example an arry of strings[]
        public String[] returnTwoVals(){
            String[] returnvals = {"1","2"};
            return returnvals;
        }- expose this method in the application module
    - in the user interface drag/drop the returnTwoVals method on a page and choose to create a button.
    - double click the button to generate the binding code
        public String commandButton_action() {
            BindingContainer bindings = getBindings();
            OperationBinding operationBinding =
                bindings.getOperationBinding("returnTwoVals");
            Object result = operationBinding.execute();
            if (!operationBinding.getErrors().isEmpty()) {
                return null;
            return null;
        }- you can access the values in the arry by adding this code after the Object result =...
       String[] vals = (String[])result;
       System.out.println(vals[0] + " - " + vals[1]);

  • Classes and Objects

    I am new to object oriented programing. Now I think I am in little bit confusion with the concept of Basic building blocks of Object oriented programing. My doubt is;-
    1) "What Actually a class is ? Is it a user defined Data Type ?"
    2) "What actually an Object is ? Is an Object another format of a class ? Or an object is just a piece of Class, I mean is a group of Objects going to construct a class ?"
    3) "Is an object going to contain the reference of the data members only or both the data members and functions as well ? If It is going to contain both of these two then what is the Difference between a class and an object ?"
    4) "Is Constructor simply a function or something else ?"

    929663 wrote:
    I am new to object oriented programing. Now I think I am in little bit confusion with the concept of Basic building blocks of Object oriented programing. My doubt is;-
    1) "What Actually a class is ? Is it a user defined Data Type ?"More or less. You can find a more complete definition in any text or tutorial, or with a simple google search.
    2) "What actually an Object is ? Is an Object another format of a class ? Or an object is just a piece of Class, I mean is a group of Objects going to construct a class ?"Again: text, tutorial, google, or any combination.
    3) "Is an object going to contain the reference of the data members only or both the data members and functions as well ? If It is going to contain both of these two then what is the Difference between a class and an object ?"Data only. But the object also knows what class it is and where to find its class definition that tells it what methods it has.
    4) "Is Constructor simply a function or something else ?"It's not a method. It' similar to a method, in that it's a named grouping of operations, but it doesn't have a return type, and it can only be called at certain points in your code. It's job is specifically to get a newly created object into a valid initial state.
    http://docs.oracle.com/javase/tutorial/ --> http://docs.oracle.com/javase/tutorial/java/index.html --> http://docs.oracle.com/javase/tutorial/java/javaOO/index.html

  • How to properly copy and object

    I have an object that I want to keep immutable, I want to provide a copy() method so that it returns a new instance of the Object its copying. But I wanted to know, just for clarity sake, if I did this:
    public MyClass copy() {
      MyClass copy = new MyClass();
      copy.byteProperty = this.byteProperty;
      return copy;
    }And please note that byteProperty in this case is a byte[].
    Is the reference to the copy's byteProperty array a copy of the originals or a reference to it?
    I would never ever want the user of my class to be able to change the byteProperty of both the class they copied and the new copy by accident.
    For example, would doing this:
    MyClass orig = new MyClass(someByteArray);
    MyClass copy = orig.copy();
    copy.methodToChangeInternals(); //this could internally change around the byte[]would the call to methodToChangeInternals() change the byte[] in both instances?
    Thanks!

    Encephalopathic wrote:
    better than asking this question: test it out for yourself. You get the answer in several ways, by reading and by doing. There's no doubt in my mind that by doing this, you learn more and have a deeper understanding.You are right, and so I did...
    I learnt what flounder mentioned, so I implemented by copy() method differently. Using the ArrayUtils.clone() method, I made a clone of the internal state, whic worked fine.
    I then read ejp's post, and changed my class to implement Cloneable... and changed the method to clone()
    Thanks for the help guys! Very fast turn around :)

Maybe you are looking for

  • Error while Opening any Query from Query Monitor and Query Designer.

    Hill All, I was trying activate activate the Web templates for SRM, all the templates are activated and i am landed in a new problem. when ever i am trying to open a qery thru query Monitor(RSRT), i am popped with the Short dump. Short Dump Descripti

  • Boxes Around My Download Vector Files

    When I originally downloaded this icon set, they opened normally, weren't legacy. However, now when I open the original icon files they are composed of boxes. Let me try and explain- normally, you creat an amorphous vector shape with the pen tool and

  • Charging problem in car

    I have two iPad 2's, and have tried several different charging combinations for my car. We travel with two kids in the back seat and iPads are essential :-) I have tried using usb charging via cigarette outlet, and I have also tried to convert to 230

  • Best option to save data populated from a web service?

    I have manage to made a windows form that uses a web service to populate the data into a DataGridView. Then I have a column for adding comments next to each row. So a user could add some comments about this data for each row. Also I have a drop down

  • Adobe Reader X Install Error - IE 6 or Greater is Required Issue

    We are attempting to install Adobe Reader X on Windows 7 Professions 32-Bit machine with Internet Explorer 8.0 installed. Part way through the installation process, we receive an error msg that the installation cannot continue because Adobe Reader X