ADF BC and direct database call from ActionListener Method

Hi
I have an ADF BC application which generates a simple form . In the submit button I am calling a Java method which makes a direct database connection. The application hangs when the method does the executeUpdate() method
public void onSubmit(ActionEvent actionEvent) {
DBSequence prdSequenct=((DBSequence) resolveExpression("#{bindings.ProductId.inputValue}"));
          int productId = new Integer(prdSequenct.toString()).intValue();
          String productName = (String) resolveExpression("#{bindings.ProductName.inputValue}");
update(productName,productId);
public void update(String productName,int productId) {
String str ="update products set product_name=? where product_id =?";
Connection con=null;
PreparedStatement pstmt= null;
try {
con = new DatabaseConnection().getConnection();
pstmt= con.prepareStatement(str);
pstmt.setString(1, productName)
pstmt.setInt(2, productId)
pstmt.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
}finally {
try
pstmt.close();
con.close();
}catch(SQLException sqle) {
sqle.printStackTrace();
when I submit the form the update() method hangs at executeUpdate();
If I run the update() method from a standalone java its works fine.Can anybody tell what could be the issue ?
Thanks
Suneesh
Edited by: Suneesh Raman on Aug 18, 2010 10:14 AM

I am using jDev Studio Edition Version 11.1.1.2.0 . Infact I need to call a PL/SQL api from the onSubmit method which I set in the action listener of submit button of the form.
My getConnection method is :
     public Connection getConnection() throws SQLException {
          DriverManager.registerDriver(new OracleDriver());
          Connection con =
          DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","rme_pbkr", "rme_pbkr");
          OracleDataSource ods = new OracleDataSource();
          ods.setUser("rme_pbkr");
          ods.setPassword("rme_pbkr");
          ods.setURL("jdbc:oracle:thin:@localhost:1521:XE");
System.out.println("::: con = :::"+con);
          return ods.getConnection();
Does that mean we cannot make a db connection from the actionlistener implementation method ?
How to put the method in AM implementation class ? Just write a public void method there and call from onSubmit button actionlistener through some binding ?
Thanks
Suneesh

Similar Messages

  • Direct Database calls from FLEX client

    Hi all,
    is there any way to make direct database calls to a MySQL database (or any other database) from a FLEX client, rather than invoking through a service? simply, i need to remove the middle tier.
    Thanks in advance.
    SajKK

    Air only supports SQL Lite for now may be more in future.
    http://www.adobe.com/devnet/air/ajax/quickstart/sync_simple_sql_database.html
    http://www.insideria.com/2008/03/air-api-querying-a-local-datab.html
    http://ntt.cc/2008/07/08/sqlite-example-for-adobe-air-working-with-local-sql-databases-wit h-source-code.html

  • Convert the BW and PI database servers from virtual to physical servers

    Hi all,
             converting the BW and PI database servers from virtual to physical servers.
             what is the difference between Virtual & pysical database servers?
             How do we carry out the conversion?

    This [link|http://www.itworld.com/virtualization/59444/virtually-compliant-enough] may useful to you.

  • Problem with ADF security and task flow calls

    Hi.
    I am using JDeveloper 11.1.2.0.0.
    I encountered a problem when tried to apply ADF security to my application.
    The way to reproduce the problem:
    1. Create new Fusion Web Application;
    2. Import Business Components from Tables from any existing schema and add at least one table to the ApplicationModule.
    3. Create "welcome page" (for instance, welcome.jsf). Add a button with fixed action outcome "test".
    4. Create test page, for instance, test.jsf. Drag and drop any view object from Data Controls onto the page and create a form with navigation controls. Add a button with fixed action outcome "return".
    5. Create bounded task flow, name it "test", drag and drop our test page on it - the page will be the default activity. Add a task flow return activity. Add a control flow case from the default view activity to the return activity, set From Outcome property to "return". So our return button should cause the task flow to exit.
    6. Open adfc-config.xml in diagram mode and place our welcome page on it. Then drag and drop the test task flow to create a task flow call activity. Add a control flow case from welcome page to task flow call activity, set the From Outcome property to "test". So our test button should call the test task flow.
    7. Configure application to run the unbounded task flow starting with Welcome view activity.
    At this point all works as expected: when application runs, the welcome page is displayed with test button. Pressing the test button results in displaying the test page, return button leads back to the welcome page.
    Now let's configure ADF Security.
    Run the ADF Security configuration wizard, choose ADF Authentication and Authorization.
    On the second page select Form-Based Authentication, check the Generate Default Pages flag.
    On the third page choose No Automatic Grants.
    On the next page keep the Redirect Upon Successful Authentication unchecked. Press Finish.
    Open jazn-data.xml to configure roles, users and resource grants:
    1. Create application role test-role.
    2. Grant the test-role privileges to view the test task flow.
    3. Create user and grant him the test-role.
    Now we have the public available welcome page and the test page with restricted access.
    When application runs, the welcome page is displayed as expected. Pressing the test button redirect us to auto-generated login page. After successful authorization the test page is displayed. But nothing happens if we click now the return button for the first time. When we click the return button once more, the application crushes with Error-500 and message "Target Unreachable, identifier 'bindings' resolved to null". The exact error trace depends on UI control bindings, but looks like this:
    javax.el.PropertyNotFoundException: //C:/Users/DUDKIN/AppData/Roaming/JDeveloper/system11.1.2.0.38.60.17/o.j2ee/drs/Test1/ViewControllerWebApp.war/test.jsf @10,120 value="#{bindings.Id.inputValue}": Target Unreachable, identifier 'bindings' resolved to null
         at com.sun.faces.facelets.el.TagValueExpression.isReadOnly(TagValueExpression.java:122)
         at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer._getUncachedReadOnly(EditableValueRenderer.java:476)
         at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer.getReadOnly(EditableValueRenderer.java:390)
         at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer.wasSubmitted(EditableValueRenderer.java:345)
         at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer.decodeInternal(EditableValueRenderer.java:116)
         at oracle.adfinternal.view.faces.renderkit.rich.LabeledInputRenderer.decodeInternal(LabeledInputRenderer.java:56)
         at oracle.adf.view.rich.render.RichRenderer.decode(RichRenderer.java:342)
         at org.apache.myfaces.trinidad.render.CoreRenderer.decode(CoreRenderer.java:274)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.__rendererDecode(UIXComponentBase.java:1324)
    (the rest of lines skipped).
    Any suggestions?
    Edited by: user13307311 on Apr 16, 2013 11:39 PM

    @Lovin_JV_941794
    The welcome page is public available since it does not have appropriate PageDef file.
    Login page comes not from the welcome page, it comes after attempt to access the test page. So after the login succeeded the test page appears, because redirect to welcome page after successful login is not configured. I do not need to return the welcome page at this moment, I need to go to the test page.
    It seems the task flow call stack to be destroyed after redirect to login page.
    Edited by: user13307311 on Apr 17, 2013 12:45 AM

  • Stolen iPhone 4 and follow-up Call from Apple

    Hey guys,
    My girlfriends iPhone 4 (32GB locked to Rogers) was stolen about a week and a half ago. She had Find My iPhone on it and we used it to lock and clear the phone right away, but since the phone was already turned off we were not able locate it. We get an e-mail the next day from the app saying that the lock and message were sent, which means the person who stole it probably turned it on. We still weren't able to locate the phone using the app so we just assumed they re-formatted the phone, cleared it, and logged out of iCloud. We thought end of story, we lost an iPhone, but there's nothing we could do. We go to an Apple store, tell them the phone was stolen and they proceed to use Find My iPhone to clear and lock the phone again (they say they weren't allowed to brick it and we weren't given the option to report it stolen).
    Anyways, fast forward to a week later (night of Monday, Nov 5, 2012). We get a call from apple (call center 512-674-2000). The caller is Betty who works for Apple and she asks us if we have sold an iPhone on kijiji/eBay recently. We tell them that we've actually recently had the phone stolen and ask if someone's returning it. They say not quite, just that someone was tryign to contact apple with the iPhone's serial code. Unfortunately at this point the phone is very low on batter (<10%) so we ask if they can call back at another number. Betty says okay. We don't get a call back.
    We call back the apple number that called us, but the call center is closed (it was around 8:15 EST). So we call the Apple Canada Hotline (we're from Toronto). The issue gets escalated to a manager and they're pretty much saying there's no notes on why the call was made. There definately has to be a reason for apple to call us asking if the phone was sold right? They tell us to call the number that called us earlier the following day to see if we can contact Betty who called us earlier. However, they do tell us that they ahve on their record that Betty called us, and prior to that, someone called with an issue about the stolen iPhone's serial code (we had not called in).
    So we wait until the next day can call the 512 number. Pretty much we keep getting passed around with people telling us they can't do anything since there's no notes on the file and they can't redirect us to Betty.
    My question is: There HAD to be a reason why they called us right? The phone was stolen at a friends house, where we thought we knew everybody. If we can get any information on who the original call was from maybe we can find out who stole the phone? Has anyone had a similar experience or does anyone have any advice on what to do? I'm sure apple knows something, but they are just not telling us. Sorry for the lengthy post, just wanted to get all the details out there! Thanks for any help!

    But if an issue is reported using the serial code of the stolen product, could they not tell me what number it was called from?
    I understand that they can't do much, but I just wanted to know the original reason why Apple called us in the first place to ask whether we sold the iphone on kijiji or eBay recently.

  • Best practice for database calls from Java components?

    I have a java component that encapsulates some complex database logic. In unit tests, I pass in a jdbc connection.
    Is there a way to pass in a database connection from PBL for a database defined as an External Resource in an ALBPM project? That way, I can test it using the "abstract" definition in the project and know that when it is deployed to production it will use the concrete definition. And, I won't have to maintain a separate configuration of the JDBC url.
    Is there a better way to do this? Or is it possible?
    Thanks,
    Todd

    Hi Bruno,
    The main issue with the combination of stateful session beans and servlets is the servlet threading model.
    It is dangerous to store a stateful session bean reference in servlet instance state, since the servlet instance
    can be accessed concurrently, yet a stateful session bean reference is intended to be used by only one
    client.
    As you point out, one alternative is to store the reference in the HttpSession. That associates the reference
    with a particular client, which matches the stateful session bean programming model.

  • Possible to pick and choose a call from the queue? (UCCX)

    Hi All,
    I have one main UCCX queue that outside callers are placed in and I recently created an internal queue that's only reachable by internal transfers. I'm hoping to assign higher level CSRs to this new queue and use it for escalations. I was wondering if it's possible to let these escalation CSRs view the queue and select calls to answer rather than having calls automatically routed to them.
    Thanks for reading,
    Gary

    Hi Gary
    No, afraid not... callers will be served in the order determined by UCCX, which is typically FIFO. You can bump up the 'priority' of a call from within the script, but this would be based on script logic, not by the Agents cherry picking...
    Regards
    Aaron
    Please rate helpful posts...

  • Excessive database calls from DMZ portal as opposed to from internal portal

    Ever since our upgrade from 5.0.4 to ALUI 6.1 MP1, our extranet server in the DMZ is very slow to load. (36 seconds per page.) In the spy, all of the calls to the database are made repeatedly as if they are looping. When the page has completely loaded, you can still all the same calls being made to the database in the spy.
    When this box is brought from the DMZ into the LAN, it operates correctly and you only see the calls to the database the one time. All of the necessary ports are open in the firewall.
    Does anyone have any ideas? There are no errors in the log, just the continues looping of SELECT statements, etc.

    Hi ,
    As Simon pointed in previous reply , DB should not be directly updated. It should be via components which use API delivered. I haven't come across where shuch functionality is required . If the DB is allowed to updated directly , then there is a possibilty where the end user's action may corrupt the DB.
    Thanks
    Nishant

  • How can I find out the incoming call and out going call from my orher chine

    How will I know if my friend knows who I call

    It is not you who have blocked them. The caller has opted to block their number from displaying on caller id displays. You can find out who it is by answering the phone. In the future, if the caller dials (I believe) *82 before your phone number (in the us anyway) the number should appear. Ask them to do this in the future. Some medical facilities and women's shelters have caller Id blocked for privacy reasons.

  • ADF, toplink and 2 database users

    Hello,
    I'm pretty new in creating web based applications. So I did some tutorials about using ADF and Toplink.
    These tutorials are really helpful, but all examples I found use only one database user.
    I wonder if there is a way to handle 2 or more database users.
    For example I have 2 database users A and B which have the same tables an views. Now I want to display a login dialog where a username and password can be inserted. Depending to this login data the web based application should works with the tables of database user A or user B.
    Is there a way to realize this with Toplink or another technology?
    Thanks in advance,
    Hans

    Hello Hanks
    It's many was to solve your problem depending on the architecture you want implement and the type of software you want to build.
    If you may want to develop your software as an asp solution, I will recommend you to see documentation about private virtual database, label security and new encryption facilities. With private vitual database on will be able to create one architecture to serve many different customers. This is for sure very interesting in term of maintenance and in term of monitoring.
    If you may want to develop separate software modules that access separate schema to be more independant in the software version and evolution, you will be able to developp once in the top link manager and deploy your object in different place indicating in the mapping the source of your object (the schema). This may be done programmatically also. The top link documentation is very complete and helpful.
    Best regards...hope it's help

  • ADF jdevloper to call a ActionListener Method in other valueChange

    Hi all,
    i am using JDeveloper 11g Release 1
    how to call a method of type (Action Event) inside the another method of type (ValueChange Event) ?
    Please give Reply soon Thanks .

    I agree.
    Frank Nimphius wrote:
    Hi,
    dont think the action method checks if the ActionEvent is null or not. So call the method like myActionEvent(null) and then in the method ensure the code doesn't rely on an existing action event. If you require an action event, then create one as in the link you got in the previous post. However, instead of queueing the event you pass it as an argument to the method diretcly
    Frank

  • Request dispatcher and jsp pages called from servlets

              Given the following webapp directory structure:
              root/
              jsp/
              ..all jsp files
              web-inf/
              classes/
              /servlets
                   ..all servlet files
              /com
              ..all other java class files
              I have the jsp directory coded as: jspdir = "/jsp/" (and have tried variations
              on this theme)
              I try to open a new jsp page with the following code in a servlet in the above
              servlet directory:
                   RequestDispatcher rd;
                   rd = getServletContext().getRequestDispatcher(jspdir + myjsp.jsp);
                   rd.forward(req, res);
              rd continues to return null.
              The jsp pages are not registered in the web.xml file for this webapp, if that
              makes any difference.
              Does anyone have any suggestions?     
              [problem.txt]
              

    I create a small sample and put these files into /jsp in my war context
              it works fine, please send me the example code you are using and the
              environment description of the deployed application
              I attached my samples, that work
              Filip
              ~
              Namaste - I bow to the divine in you
              ~
              Filip Hanik
              Software Architect
              [email protected]
              www.filip.net
              "Bill Blackmon" <[email protected]> wrote in message
              news:[email protected]...
              >
              > Yes, I am able to access the jsp pages with the url listed.
              >
              > "Filip Hanik" <[email protected]> wrote:
              > >The weblogic servlet engine, is by default mapping anything that ends
              with
              > >*.jsp to be a JSP.
              > >so there shouldn't be a problem. You didn't answer my first question,
              > >are you able to access your JSP through the browser?
              > >http://localhost:7001/root/jsp/myjsp.jsp
              > >
              > >Filip
              > >
              > >--
              > >~
              > >Namaste - I bow to the divine in you
              > >~
              > >Filip Hanik
              > >Software Architect
              > >[email protected]
              > >www.filip.net
              > >"Bill Blackmon" <[email protected]> wrote in message
              > >news:[email protected]...
              > >>
              > >> The code you are reading in the message here was pasted in and
              > >> looks bad, so maybe that's what you are referring to? The dispatcher
              code
              > >is called
              > >> in the service() method of the servlet.
              > >> I have a suspicion that the jsp directory needs to be defined someplace
              > >-
              > >weblogic.properties
              > >> or web.xml?, though I don't see this in any of the examples that come
              > >with
              > >the product.
              > >>
              > >>
              > >>
              > >> "Simon Ng" <[email protected]> wrote:
              > >> >
              > >> >Hello Bill,
              > >> > Did you put a <BR>
              > >> >return;
              > >> ><BR>
              > >> >statement right after the dispatcher.forward() statement? Well, I am
              > >assuming
              > >> >your
              > >> >code is in the doPost() or doGet() methods.
              > >> >
              > >> >Simon
              > >> >
              > >> >
              > >> >"Filip Hanik" <[email protected]> wrote:
              > >> >>if you do http://localhost:7001/root/jsp/myjsp.jsp
              > >> >>
              > >> >>do you get a result?
              > >> >>
              > >> >>make sure you have the right character case on the filename.
              > >> >>
              > >> >>Filip
              > >> >>
              > >> >>--
              > >> >>~
              > >> >>Namaste - I bow to the divine in you
              > >> >>~
              > >> >>Filip Hanik
              > >> >>Software Architect
              > >> >>[email protected]
              > >> >>www.filip.net
              > >> >>"Bill Blackmon" <[email protected]> wrote in message
              > >> >>news:[email protected]...
              > >> >>>
              > >> >>> Given the following webapp directory structure:
              > >> >>> root/
              > >> >>> jsp/
              > >> >>> ..all jsp files
              > >> >>> web-inf/
              > >> >>> classes/
              > >> >>> /servlets
              > >> >>> ..all servlet files
              > >> >>> /com
              > >> >>> ..all other java class files
              > >> >>>
              > >> >>>
              > >> >>> I have the jsp directory coded as: jspdir = "/jsp/" (and have tried
              > >> >>variations
              > >> >>> on this theme)
              > >> >>> I try to open a new jsp page with the following code in a servlet
              > >in
              > >> >the
              > >> >>above
              > >> >>> servlet directory:
              > >> >>> RequestDispatcher rd;
              > >> >>> rd = getServletContext().getRequestDispatcher(jspdir + myjsp.jsp);
              > >> >>> rd.forward(req, res);
              > >> >>>
              > >> >>> rd continues to return null.
              > >> >>>
              > >> >>> The jsp pages are not registered in the web.xml file for this
              webapp,
              > >> >>if
              > >> >>that
              > >> >>> makes any difference.
              > >> >>>
              > >> >>> Does anyone have any suggestions?
              > >> >>>
              > >> >>
              > >> >>
              > >> >
              > >>
              > >
              > >
              >
              [filipInclude.jsp]
              [filipForward.jsp]
              [filip.jsp]
              

  • View to be parameterize and to be called from Access or Excel...advice?

    Hi guys, a couple of question: I was asked to automatically run the query below. That's mean I should no longer run manually the query changing the date and that part of query:  FOR archived
       IN (
         [201411], [201412]...                 Some suggestion how I can achieve the result? I was thinking to build a stored procedure with parameter but I'm not
    totally sure...the view below:
    alter view ChargePivot as
    with cte as (
    select nmonth, customer, [element code], [element charge],archived from Archive where Archived between'2014-11-05' and '2014-11-07'
    or Archived between'2014-12-03' and '2014-12-05'
    ), cte2 as (select nmonth, customer, [total], CONVERT(varchar(6), archived, 112) as archived
    from cte where [clothes] in ('valentino','armani')),
    cte3 as (
    select customer, archived,Nmonth, SUM(CAST([total] AS DECIMAL (20,4))) AS charge from cte2 group by
    customer, nmonth, archived)
    select * from cte3
    PIVOT
    sum(charge)
    FOR archived
    IN (
    [201411], [201412]
    ) AS PivotTableAlias

    Sorry this
    select nmonth, customer,
    [element code], [element charge],archived
    from Archive where
    Archived between'2014-11-05'
    and '2014-11-07'
    or Archived between'2014-12-03'
    and '2014-12-05'
    should have been
    select nmonth, customer,
    [clothes], [total],archived
    from Archive where
    Archived between'2014-11-05'
    and '2014-11-07'
    or Archived between'2014-12-03'
    and '2014-12-05'

  • Can I make a database call from within my rss.xml file?

    I have a rss.xml file for my web site which works just fine, but has to be manually updated each time my web site blog is updated. Is it possible to insert a sql query in my rss.xml file so it can pull the updated info automatically from my mysql db?
    I know the rss.xml file will have to be renamed with a .php extension, will it still work?

    I think this is what you are looking for[http://dev.mysql.com/doc/refman/5.1/en/xml-functions.html]
    They are called XML functions that you can set up in an .php file to export the updated file name as rss.xml, though I think it will overwrite anything already in the .xml file.
    If you care to dabble, you may already be a master, but there are some cool rss tutorials here [http://www.w3schools.com/rss/]
    Hope this helps!

  • How does ip4s identify and address the caller from Contacts on the outgoing message to a caller?

    A friend has the iP4s and has this featured activated.

    Here ya go:
    http://itunes.apple.com/us/app/youmail/id308331524?mt=8

Maybe you are looking for

  • Higher volume for video playback?

    Hello everyone! I am new to the boards and to the touchpad.  I have a question about adjusting the volume in video playback.  I woudl like to know while during the conversion process, are there any converters out there that can boost the volume?  I h

  • FM for creation of production order creation

    Hi All, Can anyone tell me the BAPI for the production order creation. BAPI for creation of production order through CO01 transaction code. Thanks in advance Ramesh.

  • Adding multiple video clips to a project?

    This is my first use of imovie 11. I imported about 60 minutes of video from my camcorder. I now have about 100 video clips in the event library. I have no interest at all in editing any of the video clips. I simply want to take the hour of footage a

  • PP Module implementation with out CO Module

    Hi friends, We are facing problem in implementing PP module because of CO areas. Here we are not implementing CO module so we have not defined controlling areas and cost centers etc. But we are getting problem related to CO in PP implementation. for

  • 10g BC4J bug in alias query column

    something strange ... i created some view's in expert mode and gave the result set aliases to replace the expression used in the select clause (select expression "Alias" from ...). The alias was mixedcase like in the parenthesis. After creating two v