Running a SQL command in my bean class

Hi all

I use JDeveloper 12.1.2.0.0.

I have an interest in running a query in my method of bean. I did some research and I always have a code but it does not find the method that the method requires so I tried to add the query in my AppModule and I added my method as a data control, but how do I access and change my method of bean?

The page with the code that does not find the method: http://jjzheng.blogspot.pt/2010/11/run-single-query-in-application-module.html

Gives me: 'Method 'getDBTransaction' not found'

The page that creates my method as a data control: http://amit-adf-work.blogspot.pt/2013/09/how-to-execute-sql-using-adf-application.html

This is the right way? How can I run a SQL command in my bean class?

Kind regards

Frederico.

This is the code I am using

GET A METHOD OF PAGEDEF AND RUN

get the link containe

BindingContainer links is BindingContext.getCurrent () .getCurrentBindingsEntry ();.

get an Action or a MethodAction

Method of the class OperationBinding = bindings.getOperationBinding ("YourMethodAction");

If there are parameters to define...

Map paramsMap = method.getParamsMap ();

paramsMap.put ("param", "value");

execute the method

Method.Execute ();

List errors = method.getErrors ();

If (! errors.isEmpty ())

{

handle errors errors here is a list of exceptions!

}

no error return to normal work

Timo

Tags: Java

Similar Questions

  • execute sql commands in the browser

    I use Oracle 10 g standard edition in the windows platform.

    I am getting SQL prompt, but I want to run the SQL commands in the browser. But I'm not.

    Please help me!

    You must start the iSQL * Plus service. Check starting the iSQL * Plus Application Server.

  • Buffer SQL commands (get, run, save, etc.) in Developer SQL does not?

    I am a developer SQL 3.1.07.42 Windows 7 64 bit with java 1.7

    I have c:\test.sql that contains
    PROMPT Working
    and c:\testscript.sql that contains
    set echo on
    set serveroutput on
    /
    GET c:\test.sql
    SAVE c:\test_working.sql
    LIST 1 LAST
    RUN
    If I open a new worksheet and type:
    @\testscript.sql
    then press F5, I get:
    @\testscript.sql
    set serveroutput on
    /
    GET c:\test.sql
    SAVE c:\test_working.sql
    LIST 1 LAST
    RUN
    If the c:\test_working.sql is not created and the content of the script is not executed.

    What I am actually trying to do here (and maybe you guys have a better idea) is to capture the output of the sql command that appears on the client, send it to the server, treat it somehow and then do everything with her (she log in my case).

    For example (a very simple example from my scripts).
    spool c:\temporary.tmp
    create table test();
    spool off;
    
    get c:\temporary.tmp
    0 begin insert into logtable (msg) (trim('
    100 ')); end;
    
    save logit.sql
    
    @'logit.sql'
    the idea is to be able to save the output of any control block / anonymous plsql in a way that can be sent to the server for processing (this is for most mistakes, of course).
    I can intercept DBMS_OUTPUT turning SERVEROUTPUT then a DBMS_OUTPUT. ACTIVATE and finally using DBMS_OUTPUT. GET all the lines and the process/log them, but I have not found a way yet to catch the rest of the "TERMOUT' of treatment other than the queue, but even then, I couldn't find a way to get the local file (content) on the server; and this idea GET/SAVE/RUN appeared to be feasible but its does not work (I even tried interactively, but maybe I'm doing something wrong).

    Any ideas/suggestions on the topic are welcome.

    Thank you.

    Hello

    According to the 3.1.04.72 SQL Developer documentation, the "get" command (among others) is not supported:
    Help | Table of contents | SQL Developer concepts and use. With the help of the SQL worksheet | SQL * more supported and unsupported statement...

    If the options are limited. If sqlplus is available and use it as an "external" tool will not conflict entirely with local policy, these links may interest you:
    Re: sqlplus vs sqldeveloper
    Easy Connect and sqldev.conn issues

    Otherwise, you can add a feature request for this on the SQL Developer and see if such an improvement is a priority for the community.

    Kind regards
    Gary
    SQL development team

  • Maximum length of the SQL command

    I created a MySQL database and a LabView 8.6 application that inserts data into the database using the SQL Toolbox.  I have a problem very long character data insertion in a LONGTEXT field.  I determined that the problem occurs when the SQL command is more than 1 048 574 characters or the length of a particular field exceeds 1 048 326 characters (cannot say who).

    The error I get is "error-2147467259 occurred at NI_Database_API.lvlib:Conn Execute.vi.  "Exception occurred in the Microsoft OLE DB provider for ODBC drivers: [MySQL] [ODBC 5.1 Driver] [mysqld - 5.1.35 - community] MySQL version disappeared in NI_Database_API.lvlib:Conn Execute.vi.

    According to the MYSQL documentation, a LONGTEXT can 4294967295 characters, so length shouldn't be a problem.  The documentation also indicates "the effective maximum length of LONGTEXT columns also depends on the maximum packet size that is configured in the client/server protocol and available memory", but I don't know how to configure the packet size in LabView.

    I enclose the code example that reproduces the problem, although it is based on a special run table structure effectively.  The table definition is included on the diagram.

    This setting must be configured outside of LabVIEW (UDL or DSN).

    You must configure the server and the client:

    I found this link while searching on stackoverflow

    http://dev.MySQL.com/doc/refman/5.1/en/packet-too-large.html

    You may need to select/Configure a specific vendor (different) in order to set this variable.

  • Cannot access the template page links in the bean class

    Hi all

    I use JDEV 12 c.

    I have a model in which I have 2 languages English and Hindi.

    Change language (when), I have re - run LOV queries for the respective language.

    so I added links method in model pagedef and try to access the same thing in the bean model class.

    When I have access to, I get Nullpointer Exception, who says the OperationBinding, does not exist in pagedef.

    is there a any restriction I can't access model pagedef in the bean class.

    Please suggest on this.

    Thank you

    Vieira

    https://blogs.Oracle.com/jdevotnharvest/entry/how_to_invoke_adf_bindings

  • GET with multiple PL/SQL commands

    Hello!

    I m try to load a file into sqlplus using the GET command. I can't use or BEGIN (if you want to know why: set escape)

    The problem is that this file has more than one command, like this:

    drop table teste_cardia;
    
    create table teste_cardia (
        id number,
        nome varchar2(255)
     );
    

    When I run the loaded file (with /). I got this error:

    C:\Cardia>sqlplus /NOLOG @aaaa.sql
    SQL*Plus: Release 11.1.0.7.0 - Production on Qua Fev 4 10:42:16 2015
    Copyright (c) 1982, 2008, Oracle.  All rights reserved.
    
    SQL> CONNECT SATIR/XPTO11TB@IDEV10G
    Conectado.
    SQL> SET SQLPROMPT "SQL>"
    SQL>SET SERVEROUTPUT OFF
    SQL>SET LINESIZE 255
    SQL>SET SCAN OFF
    SQL>SET DEFINE OFF
    SQL>SET SERVEROUTPUT ON
    SQL>SET SQLBLANKLINES ON
    SQL>SET VERIFY OFF
    SQL>SET ESCAPE ON
    SQL>GET teste4.sql
      1  drop table teste_cardia;
      2  create table teste_cardia (
      3      id number,
      4      nome varchar2(255)
      5*  );
      6  /
    drop table teste_cardia;
                           *
    ERRO na linha 1:
    ORA-00911: invalid character
    

    If I run a file with a single command without «;» This works.

    I tried to replace ';' by ' / '. Didn t work. Tried using sqlterminador, cmdsep and none of it worked.

    It s possible to have multiple commands in a file and run with GET and /?

    Hi Mario,.

    In my view, that the GET command has no for this.

    The documentation says https://docs.oracle.com/cd/B10501_01/server.920/a90842/ch13.htm

    GET loads a host operating system file in the SQL buffer.

    And in the SQL buffer, you can execute only one statement at a time.

    You can not do this

    < verdi_takt:op56 > select user from dual; select sysdate from dual;
    select user from dual; select sysdate from dual
                         *
    ERROR at line 1:
    ORA-00911: invalid character
    
    < verdi_takt:op56 > select user from dual
      2  select sysdate from dual;
    select sysdate from dual
    *
    ERROR at line 2:
    ORA-00933: SQL command not properly ended
    

    So your file with the command of 2 or more must fail.

    concerning
    Kay

  • LOV query fails, but works in SQL commands

    I am trying to create a type with semi-automatic item text field, but the query I fill in the definition of LOV returns an error:

    Impossible to analyze the query SQL LOV!

    ORA-00942: table or view does not exist

    Although when I try the same query in the form of SQL commands, it works without any problem. No idea what I am doing wrong?

    The query is as follows, where v_prt_gem_t is a view and prt_gem is a table.

    SELECT
          PG.POST_CODE||' '||PT.NAAM
    FROM
          V_PRT_GEM_T PT
          INNER JOIN
          PRT_GEM PG
          ON
          PT.NR = PG.NR
    WHERE
          LAN_NR = 4
    
    

    Julijan wrote:

    I am trying to create a type with semi-automatic item text field, but the query I fill in the definition of LOV returns an error:

    Impossible to analyze the query SQL LOV!

    ORA-00942: table or view does not exist

    Although when I try the same query in the form of SQL commands, it works without any problem. No idea what I am doing wrong?

    The query is as follows, where v_prt_gem_t is a view and prt_gem is a table.

    1. SELECT
    2. PG. POST_CODE | » '|| PT. NAAM
    3. Of
    4. PT V_PRT_GEM_T
    5. JOIN IN-HOUSE
    6. PG PRT_GEM
    7. WE
    8. PT. NR = PG. NR
    9. WHERE
    10. LAN_NR = 4

    It is likely that CERTAIN privileges on one or two tables/views used are granted for the scheme of the analysis of the application through a role, not directly to the schema. Role-based privileges will be observed in the workshop of SQL in the latest versions of database, but not for running applications. See (YABAOAE) yet another Blog about Oracle Application Express: Application Express and SQL Analysis for detailed information.

    That's why you always have to give the full APEX and the database version numbers when you ask a question: implementations and features change over time. If we know exactly which versions are used so we can determine what behavior is expected, and what bugs exist or have been corrected...

  • Apex - dbms_job.submit (Oracle) in SQL commands

    I have connected to oracle apex (version 4.2.5.00.08) at the URL https://apex.oracle.com/pls/apex/f?p=4550:1:0:

    I am trying to execute the procedure of dbms_job.submit through SQL Workshop-> SQL commands)

    The code is as shown below

    *************************************************************************************************************************

    declare

    -jobno number;

    jobno varchar2 (20);

    Start

    dbms_job. Submit (work = >: jobno,)

    This = > ' START

    emp_pack.remove_dept (16);

    END;',

    next_date = > trunc (sysdate + 1).

    interval = > 'trunc(sysdate+1) '.

    );

    -dbms_output.put_line ('Job No. :'||: jobno);

    commit;

    dbms_output.put_line ('Job No. :'|| is jobno);

    end;

    *************************************************************************************************************************

    The procedure of package I'm talking in the parameter 'WHAT' is defined as shown below

    create or replace package emp_pack is

    process remove_emp()emp_id in NUMBER)

    process remove_dept()dept_id in NUMBER)

    end emp_pack ;


    create or replace package body emp_pack

    is

    process remove_emp()emp_id in NUMBER( )

    is

    begin

    delete from EMP

      where EMP .EmpNo = emp_id ;

    end remove_emp;

    process remove_dept()dept_id in NUMBER( )

    is

    begin

    delete from dept

      where Dept .DeptNo = dept_id ;

    end remove_dept

    end emp_pack ;

    *************************************************************************************************************************

    while trying to run the piece of code (I'm passing avlaue from 35 to the jobno to the RUN time parameter) is the error I get

    ORA-06502: PL/SQL: digital or value error: character string buffer too small


    I tried to know everything, I have, but have not been able to determine what is causing the error. Help, please

    Super weird... I just ran the following on apex.oracle.com and got "1 row (s) deleted', not 'treated statement."

    declare
      l_job int;
    begin
      /* dbms_job.submit( l_job, 'begin delete from emp; end;' ); */
      rollback;
    end;
    
  • What do I need to run adsysapp2.sql in the database of R12?

    Hi, experts:


    I'm migrating a 11.2.0.3 R12 database of HP following Linux notes 741818.1. I work on the step 8. Establish the diagram of the SYSTEM. After execution of the

    script ausy1120.sql, I saw that a command in the log file says "You must run adsysapp.sql to create packages of Oracle Applications in the scheme of the SYSTEM.". What do I need to run this? It is not said in the note. At this point I just create a database structure. No given no request.


    Thanks and regards.

    Thank you so much, Hussein.

  • Use the lines of a text file as input to an SQL command

    Hello

    I have a text file containing the lines...

    123

    1234

    I would like to use as input for a SQL command running in a script. ie

    Update flag set < table > = 'Y' where job = < the text file lines >;

    Any help much appreciated.

    See you soon

    External table will do.

    For reference...

    CREATE TABLE Hold'em (SEQ_NUM NUMBER (10));

    insertion in hold select SEQ_NUM in task where proc like '% PROC;

    update set hold_flag = task ' ' where in SEQ_NUM (select hold SEQ_NUM);

  • ETG assess "in order to" in the APEX SQL command window?

    I need to recreate my table in order to change the order of the columns. When I use the SQL command window and run the SQL, it runs successfully, creates the table, but is not rearrange the columns.

    This is expected behavior?

    user648567 wrote:

    Please update your forum profile with a real handle instead of 'user648567 '.

    I need to recreate my table in order to change the order of the columns. When I use the SQL command window and run the SQL, it runs successfully, creates the table, but is not rearrange the columns.

    What do you mean by "in order to"?

    A clause using "ORDER BY" in a DEC (in SUMMIT or other anywhare) has no effect on the order of the columns , which is determined by the order in which the columns appear in the projection. It will affect the order in which the rows are returned from this query, and it will not determine the order in which lines will be returned by querying the new table in the future.

    To change the order of columns, the columns in the SELECT of the ETG clause must be in a different order than the original table,

  • FLASHBACK Database: rman vs. sql command differences

    I am new to Oracle and want to understand the difference and that is the correct way of rear turn signals to the database?


    RMAN command vs SQL command on the use of FLASHBACK DATABASE
     SQL> FLASHBACK DATABASE TO RESTORE POINT BEFORE_ONLINE_TEST;  {CODE} Vs 
    RMAN > run {}
    flashback database to restore the BEFORE_TEST_320130313 point;
    SQL ' alter database open resetlogs; }
     
    Referring this article on http://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmflash.htm#BGBDCAFA it says we can use both RMAN and SQL command for database flashback.
    
    Questions:
    
    1. Difference between using RMAN and SQL command on database flashback?
    
    2. When to use RMAN or SQL on the  database flashback?
    
    3. Which is the Oracle recommended or best way ?
    
    Edited by: Sivaprasad S on Mar 15, 2013 7:26 PM
    
    Edited by: Sivaprasad S on Mar 15, 2013 7:26 PM
    
    Edited by: Sivaprasad S on Mar 15, 2013 7:27 PM
    
    Edited by: Sivaprasad S on Mar 15, 2013 7:27 PM
    
    Edited by: Sivaprasad S on Mar 15, 2013 7:28 PM
    
    Edited by: Sivaprasad S on Mar 15, 2013 7:29 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

    So when you run your SQLPlus flashback, you get the following error:

    ORA-38761: redo log sequence 1 in thread 1, incarnation 3 could not be found

    This means so that the sequence 1 has probably been removed from the disk and is necessary.

    When you run the RMAN command look at the log what RMAN:

    * journal archived for thread 1 sequence 2 is already on the disc in the file +DG_PERF_FLASH_02/TestDB/archivelog/2013_03_14/thread_1_seq_2.3612.810054205*
    * journal archived for thread 1 with sequence 3 is already on the disc in the file +DG_PERF_FLASH_02/TestDB/archivelog/2013_03_14/thread_1_seq_3.1588.810054205*

    So sequence 2 and 3 are already on record according to the above message.

    Then you get this message:

    channel dev_2: restoration of archives Journal
    Archives journal thread = 1 sequence = 1

    So RMAN knows he needs 1 thus sequence and restores this newspaper archive she needs for recovery.

    In a Word while running SQLPlus she communicate with RMAN and restore the log file for you, however with RMAN, it won't.

    You can restore the newspaper archive manually, and then run in SQLPlus that will then work.

    Published by: Freddie Essex on March 18, 2013 12:46

  • SQL command not properly ended.

    Hello
    I have connected the aplication to the oracle database in developer j. I used the Insert buttons and validation included.
    For debugging application it runs correctly. but sometimes it gives error sql command not completed successfully.
    I checked the requests when it runs successfully, it runs the query ' insert into Schema_name.table_name (column names) values (?)'.
    but when it gives an error it runs the query ' insert into Schema_name. Schema_name. Schema_name. Schema_name. Schema_Name.table_name(column names) VALUES (?) e

    Can someone tell me what is the reason of it?

    Thank you.

    Can you try to change your query of

    SELECT CD_ID, Data_Type, Data_Value, Misc1, Misc2 FROM Sample_ADF_FinIQ_Common.Common_data
    

    TO

    SELECT CD_ID, Data_Type, Data_Value, Misc1, Misc2 FROM Common_data
    

    Note that I deleted the schema name of the query. Specific no reason why you use in front of the table schema name (I assume that you have created the connection to the schema on which you perform these operations).

    Arun-

  • ORA-00911 during addition of comment in the SQL command.

    I work within the ORACLE Database Express Edition page "SQL Command".

    The following query works fine for me:

    SELECT *.
    CUSTOMERS

    As soon as I add comments, I get an error ORA-00911:

    -It is a comment.
    --
    SELECT *.
    CUSTOMERS

    ORA-00911: invalid character

    Hello

    Apex SQL worksheet don't like comments. What is reason you like add comments when you run the query?
    You can try

    SELECT *
    /*This is a comment.*/
    FROM CUSTOMERS
    

    Kind regards
    Jari

  • How to view and current directory to run an SQL script

    Hello
    Questions about a few simple things in sql command line plusent, but they are really hard to find in the documentation:

    1. is there an easy way to set an environment variable changing a working directory where a script is running?
    2. How can I view path environment?

    Kind regards
    Valerie

    SQLPATH? Example:

    C:\>type \tmp\test.sql
    select 1 from dual;
    
    C:\>sqlplus test/test
    
    SQL*Plus: Release 10.2.0.1.0 - Production on Fri Aug 28 11:47:56 2009
    
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    
    Connected to:
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    
    SQL> @test
    SP2-0310: unable to open file "test.sql"
    SQL> exit
    Disconnected from Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    
    C:\>set SQLPATH=c:\tmp
    
    C:\>sqlplus test/test
    
    SQL*Plus: Release 10.2.0.1.0 - Production on Fri Aug 28 11:48:19 2009
    
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    
    Connected to:
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    
    SQL> @test
    
             1
    ----------
             1
    
    SQL>
    

Maybe you are looking for

  • Ethernet cables

    ! have a pair of gigabit Powerline AV500 (XAV5001 which my son has me but I do not have the original ethernet cables.) Can I use any other cables?

  • dysfunctions of iMac early 2008 2nd memory slot

    I tried to upgrade my iMac in early 2008 by adding a 2nd memory card in slot 2 with a correct map of OWC. also badly hit by installing Apple's original card for slot 2 & OWC in slot 1. When a card is installed in slot 2 the hard drive just repeatedly

  • To set the printer on my existing home network

    Just got a HP ENVY 5530 and put in place yesterday.  It is set up its own network and I want it set to my home network.  I can't print from my phone unless I have manually enter and change my network of phones on the network printer.  Help, please!

  • Read mail ICON does not call outlook or outlook express

    Just converted to IE8 to IE7.  Read mail ICON in the command bar does not start the e-mail program - Outlook Express

  • How to remove locks on folders icons in Windows XP?

    Windows XP. I need to remove the icon of the lock my files in the Documents and my pictures, so that I can open them.