Run query from java code

Hi all

I have a requirement in which I need to create a selection based on the parameter query that user input. If the query will include the parameter if its value is not null.

Is it possible to add this query in the resource file?

In case I want to execute java code, how can I call to run the query of theis?

I tried result Long = ws.executeSQL (query.toString ());

but it gives an error because executeSQL is for DML queries.

Please suggest an approach.

If you do not know the name of the column, you must use createResultSetSQL.

Jonathan

http://jonathanhult.com

Tags: Fusion Middleware

Similar Questions

  • Try to call from java code process.

    What do we call a task of IOM process from java code?

    Thor.API.Operations.tcProvisioningOperationsIntf has long addProcessTaskInstance (long plTaskKey, long plOrcKey) API.

    Please visit http://download.oracle.com/docs/cd/E17904_01/apirefs.1111/e17334/Thor/API/Operations/tcProvisioningOperationsIntf.html for more information

  • How to get to variable in backing_bean from java code

    I need to reach one of my variable in a backing_bean of java code (when click the button I need to get the value of the variable is on one of the backing_bean)
    I have defined the field of beans as session
    what I need to do

    Copy the following code in my bean

    private String loginType.

    public String cb2_action() {/ / I call this method}
    setLoginType ("skip");
    }

    and in this method, I try to get the value of the parameter

    public String getLoginType() {}
    FacesContext fctx = FacesContext.getCurrentInstance ();
    ELContext elctx = fctx.getELContext ();
    Application = fctx.getApplication ();
    ExpressionFactory exprFactory = application.getExpressionFactory ();
    ValueExpression valueExpr =
    exprFactory.createValueExpression (elctx, "#{bindings.loginType.inputValue}", Object.class);
    oracle.jbo.domain.Number departmentId = null;
    loginType = (oracle.jbo.domain.Number) valueExpr.getValue (elctx);
    "" return loginType + ' ";
    }

    When I run the code it returns null

    so, in this case... Set the connection type in a sessionscope... and access it anywhere...

                Map sessionMap = (Map)ADFUtils.evaluateEL("#{sessionScope}");
                sessionMap.put("loginType",loginTypeValue); // loginType value is set here..
    
    //access it outside like
                Map sessionMap = (Map)ADFUtils.evaluateEL("#{sessionScope}");
               sessionMap.get("loginType");
    
  • How to simulate BlackBerry options/commands from java code?

    Hi friends,

    For wipe/erase of personal data, we have the following option on BlackBerry phone (model: 9930)
    Options of-> Security-> Security Wipe

    I want to give the same option in my BlackBerry App (e.g.. A button marked "clear data")
    How can I simulate the same functionality through java code

    Can someone please provide some help or provide a reference to the entire API

    Thank you

    Laughing out loud
    You can enter simulation (clicks, presses), and you can launch native applications, if you know their module name, but both approaches have their limitations.

    See http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/system/ApplicationManager.html... or http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/system/ApplicationManager.html... to see how to apply.

  • Read current user connected from java code VOImpl

    Hi experts,

    I use Jdev 12.1.3 and I would like to read the value of adf.context.securityContext.getUserName () in the java code of a VOImpl so I can pass it as a parameter to a PLSQL stored procedure.

    How can I do?

    Thank you very much
    Jose.

    You can use the code below:

    String currentUser store = ADFContext.getCurrent () .getSecurityContext () .getUserPrincipal () .getName ();

    Thank you

  • Read configuration data source AM from Java Bean code

    Hi experts,


    I use Jdev 12.1.3 and I need to read the name of AM Datasource from Java Code, to get a text like "jdbc/nomsourcededonnees.


    Is this possible?

    Thank you very much
    Jose.

    This object has methods getURL(), getUser() and others.

    But there is no method as getDataSourceName()

    (AFAIK, jdbc connection "knows" nothing about the Data Source)

    You can try something like this inside your AppModuleImpl class:

    this.getSession () .getEnvironment () .get (Configuration.JDBC_DS_NAME)

    Dario

  • How to kill a process of the system of java code.

    Hi,


    i need to kill or remove windows system process like cmd.exe from java code.

    as detached from end process in task mgr.

    i tried below code but its not removed.

    is there a better way we can do this.

    killing a system process from java code will create any issues?


      
    public static void main(String[] args) throws Exception {

      
    String[] cmd = { "cmd.exe" };
      
    Process p = Runtime.getRuntime().exec(cmd);
       p
    .destroy();
      
    }


    any suggestions or ideas are really appreciated.

    Thank you.


    The utility 'tasklist' will give you the same basic information in the Task Manager. You can always capture that and find the line (including the PID) of your application.

    Use your favorite search engine and look for "windows get the pid using java. You will find LOTS of other posts for this same issue.

  • How to get the value on a model that is defined in the java code in email

    Hello

    I created a custom code and send email as well to custom component. I can send emails using the method:

    InternetFunctions.sendMailTo (EmailID, EmailTemplate, subject, cxt);

    But my problem is that I have to get a value in the model of "EmailTemplate" which are defined from java code. but I don't know how to get the value.

    I will highlight in the java code by using this code: binder.putLocal ("ErrorApproveRejectMsg", massegeBody);

    I'm trying to enhance the model using the code below, but not able to get.

    1 < $exec getValue ("#active", "ErrorApproveRejectMsg") $ >

    2 < $exec getValue ("#active", ErrorApproveRejectMsg) $ >

    3 < getValue ("ErrorApproveRejectMsg") $exec $ >

    4 < $exec getValue (ErrorApproveRejectMsg) $ >

    5 < getValue ("#local", ErrorApproveRejectMsg) $exec $ >

    6 < getValue ("#local", "ErrorApproveRejectMsg") $exec $ >

    7 < $ErrorApproveRejectMsg$ >

    8 < $exec ErrorApproveRejectMsg$ >

    Assuming that cxt will be your Service or execution context object

    You can do something like this

    DB. PutLocal ("ErrorApproveRejectMsg", "Error");

    cxt.setCachedObject ("DataBinder", db);

    PageMerger h = new PageMerger (db, cxt);

    cxt.setCachedObject ("PageMerger", h);

    InternetFunctions.sendMailTo (usersEmail, emailTemplate, emailSubject, cxt);

    where db is current databinder object, and you can put any variable custom in the workbook by using the putLocal method.

    Thank you

    Vikram

  • How to trigger an ActionListener JAVA code?

    Hello

    I have the button and the button has an ActionListener attached.

    I want to trigger the ActionListener from java code (no click in the interface).

    How can I do this?

    Thank you.

    I found the answer.

    save.doClick ();

  • How to create a BPEL Process task using java code

    Hello

    I created a BPEL process (for creating task), in which my requirement is that I need to create a task based on some inputs and assign it to the user in partucular and then get out of this flow.

    earlier, I felt that I will use the human task activity. but when I use that task will be created in the same process and proceedings will be stuck on there until human intervention (the BPEL process waits for the result.).

    is it possible that I can use Java activity and create tasks from java code, 'I know how to assign a specific user task. Please tell me.
    Abhishek

    Published by: abhishek on April 25, 2011 12:42 AM

    Hi Abhishek
    1. you can try this alternative approach and it should work.

    2. basically, most of the BPEL process eventually auto generated Web services (.) WSDL). When we create a BPEL process, everything we do is give diagram of input, output schema and creates a bpel process with the default operation named as "process" in all the old versions as up to 11.2 SOA (and maybe before). BUT SOA 11.3 from, we can create a process BPEL, with our own WSDL and our own scheme. There is no restrictions like having only a single operation named 'process', etc.. In any case, what I mean is, each BPEL process ends up as a WebService, with entry and exit of the payloads of XSD.

    3. from the JDeveloper itself, locate the .wsdl for your BPEL process under the Workflow project. Create a new project of Proxy customer service Web and generate a customer for this wsdl Web service proxy. This will create you Service, Port and JAVA classes equivalent payload theoretically in your case taskpayload.xsd with these 4 items you have. Ignore the full blown the HumanTask which has all the system elements and attributes of a task of bpel. All you need is to undertake a task with your own payload data. Create a simple Client Java (EJB or Servlet later to make more flexible). In this Java client, retrieve the Service object in the proxy and port. Then instantiate the java class that represents the payload. Set 4 values you want and set the user name, etc. You may need some adjustments for the setting of the user. Then the port invoke otherwise (go your java object here).

    Sample code snippet
    prepare the message for BPEL of appeal; Define the fields that can not be null
    MyPayloadRequest myPayloadRequest = new MyPayloadRequest();
    myPayloadRequest.setInitiator("");
    myPayloadRequest.setTitle("");
    myPayloadRequest.setEmployeeName("");
    myPayloadRequest.setEmpContact("");

    web service client Get for BPEL receive point and call: first generate client proxy
    MyBPELPProcess_client_ep serviceClient = new MyBPELPProcess_client_ep();
    MyBPELPProces proxy = serviceClient.getNewMyBPELPProces_port ();
    proxy. Process (myPayloadRequest);

    Please note that you can also use the SOA workflow API and the Manager back call personalized for this first task classes. In this class, you can have the methods of the interceptor, which is called each time a task is initiated, saved, Submit, approve etc etc (all events essentially). This gives you access to all the objects in a workflow with full charge blown. So you can always get the data you pass above and in this custom class, the value of the user, date/time etc..

    It's just a different approach you can try.

    Thank you
    Ravi Jegga

  • Send messages via the java code, but using definitions of Mail

    Hello

    I want to send mails using java code, but reading the data (body, subject, sender, etc.) of the IOM Mail definitions.

    can someone send me a link or a thread where this method is used?
    or a reference to some Thor API manual.

    Thank you.

    You can use tcEmailOperationsintf API to call IOM Email definitions from java code.

    Here is the snippet of code on the use of this API.

    {} public void getEmailTemp (String email_def_name)
    tcEmailOperationsIntf emailIntf = null;
    resSet tcResultSet = null;
    Map emailMap = new HashMap();
    emailMap.put ("Email Definition.Name", email_def_name);
    try {}
    emailIntf = getUtilityFactory() (Thor.API.Operations.tcEmailOperationsIntf)
    .getUtility ("Thor.API.Operations.tcEmailOperationsIntf");
    resSet = emailIntf.findEmailDefinition (emailMap);
    for (int i = 0; i)< resset.getrowcount();="" i++)="">
    resSet.goToRow (i);
    Void String = resSet.getStringValue ("Email Definition.Subject");
    System.out.println ("subject of the email is:" + sub);
    String body = resSet.getStringValue ("Email Definition.Body");
    System.out.println ("body of the email is:" + body);
                                  
    }
    } catch (tcAPIException e) {}
    System.out.println ("Exception occurred in the getEmailTemp method:" + e);
    } catch (tcColumnNotFoundException e) {}
    System.out.println)
    «cloumn illegal name allowing access to the getEmailTemp method: "+ e);»
    }
    System.out.println ("getEmailTemp smoothly method");
    }

    You can use this code for your reference.

  • Run the java code when passing a parameter value.

    JDeveloper 11.1.2.1
    ADFbc + JSF

    I have two pages: Page1 call Page2 passing the parameter p1.

    I need to run java code in a bean. every time when Page2 is called with a value in the parameter p1.
    When I need to place the code to run when the page displays the data?

    Thank you

    Put a router between the pages element, it you decide if to call your method (and access method activity), or go directly to the page.

    Timo

  • Java code to extract data from a custom table to form

    I need to transfer data from one table to the form. Please provide the java method to do this. The table has 4 columns. I need to fill in all the data form as level. It will be a great help if sombody can provide the same java code and the logic of xpress to achieve the same.

    Please refer to the documentation for the com.waveset.util.JdbcUtil API. The class has functions for the features you need.

  • Run JAVA code on a UDF value as OID process update

    Hello
    I have a JAVA code that I want to run as soon as "UDF Updated" task runs. I created this task on the "Update of the FDU" process, which is integrated into the map "adpOIDModifyUser". I want to run this JAVA code at the same time where there is a change in the value of the UDF and then this UDF value is pre-populated also in the form of process OID and then finally thrust to OID.

    Basically I want these 2 tasks to occur at the time of the update of the UDF:
    1.) run the JAVA code by taking the new value of the UDF.
    2.) push the new value of the UDF in OID.

    I created and all the changes in the lookup.usrprocesstriggers, tasks 2 process 'change UDF' and 'udf' updated and all that good stuff.
    But I'm stuck at creating a task in JAVA and how to operate as a dependant on the UDF update task.

    Anyone have any ideas?

    Thank you
    -oidm.

    Just to see all the answers carefully.

    See their description. You will find a description that tells you this task is completed. It is mapped to some C.

    Just select this answer and see below, you will have the task to which it. Click Add task, and then select your task in which you attached your java code.
    SO, whenever your update triggers or completed task successfully it wil trigger another task
    Let me know if you need any other information.

    As I have machine with you, I'm not able to tell the name of the exact answer. If you see carefully you will easily find it.

  • Where to put the java code - best practices

    Hello. I work with the Jdeveloper 11.2.2. I'm trying to understand the best practices for where to put the code. After reviewing the http://docs.oracle.com/cd/E26098_01/web.1112/e16182.pdf, it seemed that request module was the preferred location (although many examples in the pdf file reside in the main methods). After some time of coding, if, I noticed that there was a certain libraries imported and wondered if this would impact performance.

    I looked at the articles published on the forum, in particular Re: programmatically access the method of service (customer interface) . This link mentions for access to the code a bean of support - and the bulk of the recommendations seem to be using the data control to drag to the Joint Strike Fighter, or use the links to access code.

    My interest lies in where to put the java code in the first place; In the view object, entity object, and... other Am, backing bean object?

    I can describe several guess better know where to put the code and the advantages and disadvantages:

    1. in the application module
    Benefits: Central location for code makes development and support easier as there are not multiple access points. Kinda like a data control centralizes the services, the module of the application can act as a conduit for the different parts of the code you have in your model objects.
    Cons: Everything in one place means that the module of the application becomes bloated. I don't know how the memory works in java - if the app module has tons of different libraries are all called when even a method of re - run a simple query is called? Memory of pigs?

    2. write the code in the objects it affects. If you write code that accesses a view object, write it to a display object. Then make it visible for the customer.
    benefits: the code is accessible through ducts less (for example, I expect that if you call the module from the application of a JSF backing bean, then the module of the application calls the view object, you have three different pieces of code-)
    CONT: the code gets spread, more difficult to locate etc.

    I would greatly appreciate your thought on the issue.


    Kind regards
    Stuart

    Published by: Stuart Fleming on May 20, 2012 05:25

    Published by: Stuart Fleming on May 20, 2012 05:27

    First point here is when you say 'where to put the code of java' and you're referring to ADF BC, the point is that you put 'code of java business logic' in the ADF business components. Of course it is very good to have the Java code in the ViewController layer that covers the user interface layer. Just don't put the business logic in the user interface layer and don't put no logical user interface in the model layer. In your 2 examples you seem to consider the ADF BC layer only, so I'll assume that you're not only serious logic java code.

    Meanwhile, I'm not keen on best practices in the term that people are following best practices without thinking, usually best practices come with conditions and forget to apply. Fortunately you do not here that you have thought through the pros and cons of each (nice work).

    Anyway, back on topic and turn off my soap box, regarding where to put your code, my thoughts:

    (1) If you have only 1 or 2 methods set in the AppModuleImpl

    (2) If you have hundreds of methods, or there is that a chance #1 above will turn into #2, divide the code between the AppModuleImpl, the ViewImpl and the ViewRowImpls. Why? Because your AM will become overloaded with hundreds of methods making it unreadable. Put the code where it should logically go instead. Methods that operate on a specific line of VO Approfondissez partner ViewRowImpl, methods that work across lines in a VO enter the ViewImpl and methods that work throughout your in the associated AppModuleImpl.

    To be honest that you never the option you choose, one thing I recommend as a best practice is to be consistent and document standard so not know your other programmers.

    BTW, it is not a question about loading a lot of libraries/imports in a class, it has no performance cost. However if your methods require a lot of class variables, then yes there will be a memory of the costs.

    On a side note, if you are interested in more ideas on how to create ADF applications properly think about joining the EMG "ADF", a forum which deals with ADF architecture, best practices (cough), deployment architectures free online and more.

    Kind regards

    CM.

Maybe you are looking for