Multiple Parameters in Main()

I have been going through the tutorials in Java. I have gotten to the explanation on the main() method in which you can sent parameter values to when you start the app. I can get my .java file to compile with two parameters in the main() but when I try to run the app java HelloWorld firstParameter, secondParameter I get an error. My parameters are
public static void main(String[] args, int argss)
Thanks for the Help

java -cp . com.paperstack.Foo arg1 arg2 42 Hello WorldThe above says, in plain english:
Load the class "com.paperstack.Foo"
Find the method that looks like this: public static void main(String[] argv)...
Take everything after the class name
Split it into strings separated by spaces
Turn them into an array
Call the main method, passing in the array of strings as the parameter.
So, yes, by definition the main method has only "one" parameter, but that's an array containing all the command line parameters after the class name - in the above example, that's the same as:
String[] argv = new String[] { "arg1", "arg2", "42", "Hello", "World" };
You can convert a numeric string into a number quite easily. Look at the Integer class documentation.
You can declare any other method you want to with more or less as many parameters as you want to, but "the" main method by definition can only have one and it has to be an array of strings.
Dave.

Similar Messages

  • Problem while Binding multiple Parameters to View Object[Solved]

    Hello,
    I am facing problem while binding multiple parameters with different data types in View Object query. For example suppose I have following query in my view object.
    SELECT Header.ADDED_BY
    Header.BATCH_ID,
    FROM BATCH_HEADER Header
    WHERE :1='deptAdmin' and Header.BATCH_ID
    in
    select batch_id from batch_header_dept_mapping where dept_id in(SELECT * FROM TABLE(CAST(:0 AS TABLE_OF_VARCHAR)))
    I am able to pass the Bind variables of Array type for : 0 , using Steve's ArrayOfStringDomain example. (ArrayOfStringDomain) .
    But after passing value to second bind parameter ie.. :1 .
    I am getting the error as follows.
    ## Detail 0 ##
    java.sql.SQLSyntaxErrorException: ORA-00932: inconsistent datatypes: expected - got CHAR.
    I tried to set
    setWhereClauseParam(1,11); // 11 is Number
    setWhereClauseParam(0,arr); // arr is arr = new Array(descriptor,conn,deptid); for in parameter.
    But of no use , Please let me know if any thing missing form me or have any another solutions. Also please provide me any example if have.
    Thank you,
    Sandeep
    Edited by: user11187811 on Oct 23, 2009 7:27 AM
    Edited by: user11187811 on Oct 26, 2009 12:52 AM
    Edited by: user11187811 on Oct 26, 2009 6:51 AM

    hi.
    but when using non-Oracle named parameter binding styles as you've done (ie. , :1), regardless of what number you give each bind variable, they are sequenced 0, 1, 2 etc. As such your bind variable :1 is the 0th parameter, and your bind variable  is the 1st parameter.Your statment is correct.
    :1 i used was actually on 0th position and :0 was on 1 position. Like you said in sequence 0,1,2 etc. Now i get the answer and i corrected My mistake by assigning right values to right binding variable. and problem just solve.
    Thanks Chris.

  • How to call stored procedure with multiple parameters in an HTML expression

    Hi, Guys:
    Can you show me an example to call stored procedure with multiple parameters in an HTML expression? I need to rewrite a procedure to display multiple pictures of one person stored in database by clicking button.
    The orginal HTML expression is :
    <img src="#OWNER#.dl_sor_image?p_offender_id=#OFFENDER_ID#" width="75" height="75">which calls a procedure as:
    procedure dl_sor_image (p_offender_id IN NUMBER)now I rewrite it as:
    PROCEDURE Sor_Display_Current_Image(p_n_Offender_id IN NUMBER, p_n_image_Count in number)could anyone tell me the format for the html expression to pass multiple parameters?
    Thanks a lot.
    Sam

    Hi:
    Thanks for your help! Your question is what I am trying hard now. Current procedure can only display one picture per person, however, I am supposed to write a new procedure which displays multiple pictures for one person. When user click a button on report, APEX should call this procedure and returns next picture of the same person. The table is SOR_image. However, I rewrite the HTML expression as follows to test to display the second image.
    <img src="#OWNER#.Sor_Display_Current_Image?p_n_Offender_id=#OFFENDER_ID#&p_n_image_Count=2" width="75" height="75"> The procedure code is complied OK as follows:
    create or replace
    PROCEDURE Sor_Display_Current_Image(p_n_Offender_id IN NUMBER, p_n_image_Count in number) AS
        v_mime_type VARCHAR2(48);
        v_length NUMBER;
        v_name VARCHAR2(2000);
        v_image BLOB;
        v_counter number:=0;
        cursor cur_All_Images_of_Offender is
          SELECT 'IMAGE/JPEG' mime_type, dbms_lob.getlength(image) as image_length, image
          FROM sor_image
          WHERE offender_id = p_n_Offender_id;
        rec_Image_of_Offender cur_All_Images_of_Offender%ROWTYPE;
    BEGIN
        open cur_All_Images_of_Offender;
        loop
          fetch cur_All_Images_of_Offender into rec_Image_of_Offender;
          v_counter:=v_counter+1;
          if (v_counter=p_n_image_Count) then
            owa_util.mime_header(nvl(rec_Image_of_Offender.mime_type, 'application/octet'), FALSE);
            htp.p('Content-length: '||rec_Image_of_Offender.image_length);
            owa_util.http_header_close;
            wpg_docload.download_file (rec_Image_of_Offender.image);
          end if;
          exit when ((cur_All_Images_of_Offender%NOTFOUND) or (v_counter>=p_n_image_Count));
        end loop;
        close cur_All_Images_of_Offender;
    END Sor_Display_Current_Image; The procedure just open a cursor to fetch the images belong to the same person, and use wpg_docload.download_file function to display the image specified. But it never works. It is strange because even I use exactly same code as before but change procedure name, Oracle APEX cannot display an image. Is this due to anything such as make file configuration in APEX?
    Thanks
    Sam

  • How To Pass Multiple Parameters In URL with Report Builder

    Hi,
    I use apex 4.2 with database xe 11g and i use report builder to build my report i use this link to call report
    function runrep(){
    var vurl = 'http://192.168.0.57:8889/reports/rwservlet?userid=retail/1@xe&destype=cache&desformat=PDF&paramform=no&report=item_cost&P_BATCH_NO='+$v('P138_BATCH_NO');
    popupURL(vurl);
    now i want to pass Multiple Parameters like P138_ITEM_CODE , P138_UOM_CODE
    how can i add this Parameters in URL ?
    Regards
    Ahmed

    Ramani_vadakadu wrote:
    window.open("http://hq-orapp-03.kuf.com:9704/xmlpserver/~weblogic/kufpec/BTA/KUF_CONF_ITINUD.xdo?_xpf=&_xpt=1&_xdo=%2F~weblogic%2Fkuf%2FBTA%2FKUF_CONF_ITINUD.xdo&_xmode=&_paramsP_BTM_ID="+parseInt(document.getElementById('P3_BTA_ID').value)+"&_xt=KUF_CONF_ITINUD&_xf=pdf&_xautorun=true&id=weblogic&passwd=kuf2011","_blank");
    the above code we are using apex JS to BI publisher calling for report as PDF
    i don't know exactly where your parameters , did you customize my link to multiple parameters
    'http://192.168.0.57:8889/reports/rwservlet?userid=retail/1@xe&destype=cache&desformat=PDF&paramform=no&report=item_cost&P_BATCH_NO='+$v('P138_BATCH_NO'); 

  • Passing multiple parameters between two report portlets on the same page

    Hi,
    I want to pass multiple parameters between two report portlets on the same page.
    I have been succussful passing a single parameter between two portlets. The
    following are the steps :
    (1) Created first report based on the query
    SELECT htf.anchor('http://192.168.0.84:7778/servlet/page?&_pageid=97&_dad=portal30&_schema=portal30&_mode=3&dept_code='||DEPTNO,DEPTNO) Department, ename FROM EMP;
    (2) Created 2nd report
    select * from EMP where DEPTNO = :dept_code
    (3) Added pl/sql code before display page on the 2nd report
    portal30.wwv_name_value.replace_value(
    l_arg_names, l_arg_values,
    p_reference_path||'.dept_code',portal30.wwv_standard_util.string_to_table2(nvl(g
    et_value('dept_code'),10)));
    (4) Created a page and added these reports as portlets.
    Sofar it works fine for one parameter (deptno) . Now I want to add one more
    parameter say empno to my first report query and would like to pass both the
    parameters deptno and empno to the 2nd report. Please tell me how to pass multiple parameters ?
    Thanks
    Asim

    Hi,
    You will have to do the same thing
    The select will be like this
    SELECT htf.anchor('http://toolsweb.us.oracle.com:2000/servlet/page?_pageid=97&_dad=mb&_schema=mybugs&_mode=3&dept_code='||DEPTNO||'&empno='||empno,DEPTNO) Department,ename
    FROM EMP
    In the additional plsql code do the same for empno like this
    mybugs.wwv_name_value.replace_value(l_arg_names,l_arg_values, p_reference_path||'.dept_code',mybugs.wwv_standard_util.string_to_table2(nvl(get_value('dept_code'),10)));
    mybugs.wwv_name_value.replace_value(l_arg_names,l_arg_values, p_reference_path||'.empno',mybugs.wwv_standard_util.string_to_table2(get_value('empno')));
    Thanks,
    Sharmila

  • MDM ABAP API: Query with Multiple Parameters

    I would like to query MDM repository passing multiple parameters. I used the following code, however, it didn't work.
    If I pass only one parameter, it works fine.
    DATA lt_query                  TYPE mdm_query_table.
    DATA ls_query                 TYPE mdm_query.
    DATA lv_search_text       TYPE string.
    DATA lt_result_set            TYPE mdm_search_result_table.
    DATA ls_result_set           LIKE LINE OF lt_result_set.
    * Fill query structure with FIRST parameter
        ls_query-parameter_code  = 'Name'.
        ls_query-operator        = 'CS'. 
        ls_query-dimension_type  = mdmif_search_dim_field.    
        ls_query-constraint_type = mdmif_search_constr_text.
        lv_search_text = 'BMW'.
        GET REFERENCE OF lv_search_text INTO ls_query-value_low.
        APPEND ls_query TO lt_query.
    * Fill query structure with SECOND parameter
        ls_query-parameter_code  = 'Model'.
        ls_query-operator        = 'CS'. 
        ls_query-dimension_type  = mdmif_search_dim_field.    
        ls_query-constraint_type = mdmif_search_constr_text.
        lv_search_text = '2009'.
        GET REFERENCE OF lv_search_text INTO ls_query-value_low.
        APPEND ls_query TO lt_query.
    * Query on records (search for value 'BMW' model '2009' in table Products)
        CALL METHOD lr_api->mo_core_service->query
          EXPORTING
            iv_object_type_code = 'Products'                  
            it_query            = lt_query
          IMPORTING
            et_result_set       = lt_result_set.

    Hi,
    I see you are not clearing your local structure "ls_query".  This could be reason of problem,  try this and let us know the result:
    DATA lt_query                  TYPE mdm_query_table.
    DATA ls_query                 TYPE mdm_query.
    DATA lv_search_text       TYPE string.
    DATA lt_result_set            TYPE mdm_search_result_table.
    DATA ls_result_set           LIKE LINE OF lt_result_set.
    Fill query structure with FIRST parameter
        ls_query-parameter_code  = 'Name'.
        ls_query-operator        = 'CS'. 
        ls_query-dimension_type  = mdmif_search_dim_field.    
        ls_query-constraint_type = mdmif_search_constr_text.
        lv_search_text = 'BMW'.
        GET REFERENCE OF lv_search_text INTO ls_query-value_low.
        APPEND ls_query TO lt_query.
    CLEAR ls_query.
    Fill query structure with SECOND parameter
        ls_query-parameter_code  = 'Model'.
        ls_query-operator        = 'CS'. 
        ls_query-dimension_type  = mdmif_search_dim_field.    
        ls_query-constraint_type = mdmif_search_constr_text.
        lv_search_text = '2009'.
        GET REFERENCE OF lv_search_text INTO ls_query-value_low.
        APPEND ls_query TO lt_query.
    CLEAR ls_query.
    Query on records (search for value 'BMW' model '2009' in table Products)
        CALL METHOD lr_api->mo_core_service->query
          EXPORTING
            iv_object_type_code = 'Products'                  
            it_query            = lt_query
          IMPORTING
            et_result_set       = lt_result_set.

  • Probs sharing a report that uses SETPARAM to pass multiple parameters

    Ok we have master DB account Disco that creates reports. I also have oracle acct Duser for the users to run the reports.
    Per Metalink Note:304192.1, we've got the setparam stuff working to pass in date parameters into our sheet. This works fine when I run the report as Disco. When I try to share the report to Duser, it still prompts for the dates, but then the report returns all 0's for the results. I have no idea why this is happening.
    Any suggestions on how to share reports with other users that pass in parameters would be much appreciated. thanks!!
    Allen

    Hi Allen,
    I would always recommend that you use sys_context to pass parameters. You can search this site for sys_context or take a look at (Re: Passing multiple parameters into Custom Folder... for more details.
    Rod West

  • How to make Multiple parameters to sql query string seperated by ,(comma) ..

    Hi,
    I would like to konw how I can make multiple parameters to sql query string seperated by ,(comma)  ..
    For example, this parameters can be printed like 'abc,dde,ggf,eeg' ,once I use  "join(Parameters!rpCode.Value,",")" with report builder , 
    By the way, when I test this multiple parameters by Query Designer of report builder there was no problem,.(using Define query parameters, I put abc,dde,ggf,eeg)
    however, when I run this report , it won't be executing ,  with (rsErrorExecutingCommand)
    Plz, help me....

    If its sql query then it should like this
    Select t.*
    from table t
    inner join dbo.ParseValues(@Parameters,',')f
    on f.val = t.ID
    ParseValues can be found him
    http://visakhm.blogspot.in/2010/02/parsing-delimited-string.html
    or easier way is
    Select t.*
    from table t
    where ',' + @Parameters + ',' LIKE '%,' + CAST(t.ID AS varchar(10)) + ',%'
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to Pass Multiple Parameters To ReportReuest Method in Oracle  BI 11g

    Hi,
    Am integrate Oracle BI Publisher 11g via Web Services in Oracle Forms,For that am developing code in PublicReportServiceClient Class. This worked properly with out passing parameter to the report. so how to pass parameters to the report . If Report is requried some Parameters to generate report.
    If any one knows about How to Passing Multiple Parameters to ReportRequest Methos in Oracle 11g. Pls help me.
    Am trying with the below code for PassParameters to ReportReuest Method in Oracle BI 11g. But by using this code am able to pass only one parameter to the Report, not for multiple Parameter Passing.
    ArrayOfParamNameValue PnameValue=new ArrayOfParamNameValue();
    ParamNameValue Namevalue=new ParamNameValue();
    Namevalue.setName("P_SNO"):
    ArrayOfString aos=new ArrayOfString();
    aos.getItem().add("2");
    Namevalue.setValues(aos);
    PnameValue.getItem().add(Namevalue);
    ReportRequest RepReq = new ReportRequest();
    RepReq.setParmeterNameValues(PnameValue);
    Following method  callRunReport() with an array of parameters used in Oracle Bi 10g,To pass multiple report parameters to ReportRequest method.
    public void callRunReport (String reportPath, String[] paramName, String[] paramValue, Stringusername, String password, String format, String template, String outFile)
    try {
    bip_webservice.proxy.PublicReportServiceClient myPort =new bip_webservice.proxy.PublicReportServiceClient();
    // Calling runReport
    ReportRequest repRequest = new ReportRequest();
    repRequest.setReportAbsolutePath(reportPath);
    repRequest.setAttributeTemplate(template);
    repRequest.setAttributeFormat(format);
    repRequest.setAttributeLocale(“en-US”);
    repRequest.setSizeOfDataChunkDownload(-1);
    if (paramName != null)
    ParamNameValue[] paramNameValue = new ParamNameValue[paramName.length];
    String[] values = null;
    for (int i=0; i<paramName.length; i++)
    paramNameValue[i] = new ParamNameValue();
    paramNameValue.setName(paramName[i]);
    values = new String[1];
    values[0] = paramValue[i];
    paramNameValue[i].setValues(values);
    repRequest.setParameterNameValues(paramNameValue);

    Ramani_vadakadu wrote:
    window.open("http://hq-orapp-03.kuf.com:9704/xmlpserver/~weblogic/kufpec/BTA/KUF_CONF_ITINUD.xdo?_xpf=&_xpt=1&_xdo=%2F~weblogic%2Fkuf%2FBTA%2FKUF_CONF_ITINUD.xdo&_xmode=&_paramsP_BTM_ID="+parseInt(document.getElementById('P3_BTA_ID').value)+"&_xt=KUF_CONF_ITINUD&_xf=pdf&_xautorun=true&id=weblogic&passwd=kuf2011","_blank");
    the above code we are using apex JS to BI publisher calling for report as PDF
    i don't know exactly where your parameters , did you customize my link to multiple parameters
    'http://192.168.0.57:8889/reports/rwservlet?userid=retail/1@xe&destype=cache&desformat=PDF&paramform=no&report=item_cost&P_BATCH_NO='+$v('P138_BATCH_NO'); 

  • Passing multiple parameters to an Oracle procedure

    I'm having trouble passing multiple parameters to a stored procedure in Crystal Reports 2008 (12.2.0.290).
    I'm using an OLE DB (ADO) connection to an Oracle 10g database.
    I have created a stored procedure that has 3 parameters (in out sys_refcursor, in varchar2, in varchar2) and conforms to all of Crystal Reports' requirements for stored procedures.
    When I select my stored procedure in the Database Expert, it prompts me to enter values for both varchar2 parameters. I enter values and everything seems fine. I close the Database Expert.
    Now the stored procedure is listed in the Field Explorer, but I cannot expand the list of fields. There is a plus sign next to the stored procedure, but clicking on it does nothing. I do not get any error messages.
    If I remove one of the parameters from the stored procedure and try again, everything works fine. I've also tried using a variety of parameter types, but this problem occurs every time there are 2 or more parameters (3 including the ref cursor).
    Please help.

    Try a different Database driver...

  • Web service URL with multiple parameters

    Hi all,
    I'm trying to make use of a web service that takes multiple parameters without the use of a proxy (we're using NW 7/7.1 and  proxies aren't supported -  i.e. i'm getting the same thing as described here: Proxy object to consume web service)
    So instead I'm trying to follow a method similar to what is done [here|http://sample-code-abap.blogspot.com/2009/05/simple-code-consume-web-service-using.html]
    When I put the web service url into a browser and click on the operation it comes up with
    http://portLocation/company/webservice.asmx?op=operation
    and comes up with the sample SOAP request and response as normal.
    Now with most web services with one parameter, the url translates to something like: http://www.webservicex.net/globalweather.asmx/GetCitiesByCountry?CountryName=australia
    Which works fine.
    However, the web service i'm using has 4 parameters and when I try and translate my url to be like this (http://portLocation/Company/WebService.asmx/Operation?parameter1=XX&parameter2=XX&parameter3=XX&parameter4=XX) I get, "The page cannot be displayed"
    Can anyone suggest a way that I might be able to get around this or what I'm doing wrong.
    Thanks in advance.

    Hi,
    are you sure that your Operation is valid? So for example in your [example|http://www.webservicex.net/globalweather.asmx] there are just two operations: [GetCitiesByCountry|http://www.webservicex.net/globalweather.asmx/GetCitiesByCountry] and [GetWeather|http://www.webservicex.net/globalweather.asmx/GetWeather]. You are right about passing multiple parameters. You need to put ? after valid URL and then pairs <name>=<value> separated by &. Don't forget that you need to encode <name> and <value> to avoid problems.
    Cheers

  • Building Contextual Events with multiple parameters

    I am working in JDeveloper 11.1.1.4 and trying to build a contextual event, but ran into a issue that I find unclear. When building the Subscribers on my page definition, in the Property Inspector, how do I define multiple parameters in the customPayLoad element? In all the examples I've found, they reference putting ${payLoad} as the value and they only show one parameter. I need each value to be unique for each parameter. How do I accomplish this?

    for this you can use attributes
    say suppose if you are using table then you can pass values from producer like
                Map attributes = table.getAttributes();
                attributes.put("param1", param1);
                attributes.put("param2", param2);
                attributes.put("param3", param3);
                attributes.put("param4", param4);and consume it like
        public void handleBusinessChkListEvent(Object payload) {
            SelectionEvent selectionEvent = (SelectionEvent)payload;
            UIComponent component = (UIComponent)selectionEvent.getSource();
            String param1=
                (String)component.getAttributes().get("param1");
            String param2= (String)component.getAttributes().get("param2");
            Boolean param3=
                (Boolean)component.getAttributes().get("param3");
            String param4=
                (String)component.getAttributes().get("param4");
    }

  • Multiple parameters in Contextual Event

    Hi All ,
    I am using JDev 11.1.1.6 and WLS 10.3.6
    I want to pass two parameters as customPayLoad in the contextual Event.
    I am accessing the payload in the subscriber through ${payLoad}
    Lets say I have employees table and on rowSelection I want to pass deptId as well as EmpId in the payLoad.
    How to achieve this?

    Hi,
    Please check Forum
    Passing multiple parameters through contextual events
    Navaneetha's comment.
    http://one-size-doesnt-fit-all.blogspot.com/2010/08/jdev-11g-programmatic-contextual-events.html
    Thanks,
    Jit

  • Bi publisher report issues with selecting multiple parameters.

    Hi there I have a Bi publisher report when I query it for a single parameter it works fine and gives me the result.
    But when I select multiple parameters Lets say I have selected 3 parameters and try to view the results it does nt give me a proper report. It leaves me some blanks and gives me negative values.
    The report is working finr for one parameter In order to select two parameters I added the following code in the sql query
    and ( coalesce(null, :JOB_ID) is null
    or c.JOB_ID in (:JOB_ID)) .
    Can some one please let me know if this is correct or should I have to add anything else in the query.
    Even if I hard code it by saying JOB ID IN ('x','y','Z') and try to run the report it is not giving me exact values.
    BUt when I run the same query in database am getting correct values..
    Can anyone help me with this issue please??
    Thanks

    1. What version of BIP are you using?
    2. Can you please paste here your complete SQL data model?
    3. Can you get us an example how this will work?
    4. Can you be more specific about the error you get and the output?
    thanks
    Jorge

  • Returning multiple parameters as response from a servlet

    Hii Javaites
    I want a servlet to return multiple parameters as response.
    In my functionality , i am callling the servlet from a swing client .
    I need to get two xml strings as response from the servlet.
    Right now i am using
    PrintWriter pw=response.getWriter();
    pw.write(xmlString);
    for writing xml string . but wht if i want to send another String (xmlString2) as resposne from the servlet to the swing application ?

    You have several possibilities. If you control the XML formats you could unify the data into one XML message. You could modify your Swing app to make two requests. If it needs two separate pieces of info it is more logical to do it as two separate requests. If you really must do it this way, you could use the Zip classes (built in to Java) to put the two XML files together into a Zip file and then send that.

Maybe you are looking for

  • Where is Adobe help?????

    Very unhappy with adobe help.   All i want is to reset my adobe ID as the original email address (becomes my ID) was wrong (the 'dot' was missing between my first and last name).   So photoshop allways starts with the pop-up box saying it will sign m

  • USB32DVIPRO usb to dvi external video card

    I recently bought an USB32DVIPRO to connect a second monitor to my system, but when I plug it no new screens appear in xrandr. The dmesg output is: [16682.712967] usb 4-1: new SuperSpeed USB device number 4 using xhci_hcd [16682.728075] usbip-host 4-

  • Need some documentation on CRM middleware

    Hi, I need some really good documentation on middleware, can anyone please give me some links. Regards, Kamesh Bathla

  • Changing the graph values

    Hi.. I would like to know is there any method to edit the point,in a graph.hust like we edit scales. Thank you

  • Financial reporting (BS + PL ON Essbase)

    Hi,Can anybody help we are trying to load P&L and Balance sheet into essbase in local currency to convert to sterling (no problems here) -Firstly is there anyway of building the outline not to revalue the retained profit bought forward (as this is hi