Closing refcursors - is implied - example - refcursor OUT param in SP

Hello
I wanted to know if it is necessary to close the refcursors which are the parameters of stored procedures. They are closed implicitly or do we have to explicitly close?

If the slider's handle is passed back to a Java application, there is no way to close the cursor of the rear part. Only the side Java could close the cursor handle.

You must simply ensure that the client application is closing the game of results even in case there is a thrown exception (i.e. a finally block when you close the ResultSet object, close the investigation, close the connection).

Justin

Tags: Database

Similar Questions

  • closing Refcursor?

    Hello gurus,

    I am using among the OTN to write this procedure forum guru

    Here's how it looks to my proc
      create or replace procedure test_proc ( st_dt in date,
                                                             cv out sys_refcursor)
       as 
          begin
             Open cv for 
           select  a.col1,
                     a.col2,
                     b.col3,
          b.col4
                     from tabl_1 a,
                          table_2 b
                  where a.start_dt = st_dt
           
       end; 
    
       
    Here's my question
             
             - I m opening the cursor and querying data. so once i open do i need to close the cursor  and i m also using OUT paramter?
             - But if i close the cursor, then will i be able to get the ouptut when i execute the procedure ?
             - Do i need to use cursor attribtes  ??
             
          
    Thank you very much!!!

    RefCursor has not explicitly closed.

  • refcursor out back of a function

    Hello...
    as the topic of this thread I have indicates wud like to know if it is possible to return an ouput refcursor from a function.coz' a FN can only return a value...
    pls help me.
    CREATE OR REPLACE
    FUNCTION PRM_FN_GETHOP
    ( HOP IN VARCHAR2
    , ProcessFor IN VARCHAR2, get_hop_cursor OUT SYS_REFCURSOR) 
    RETURN varchar2
    AS
    v_current_amount number;
    BEGIN
      if ProcessFor is null then
        select PPH_CUR_AMOUNT into v_current_amount from prm_p_hop where PPH_HOP_CODE=HOP;
       return v_current_amount;
       else 
       open get_hop_cursor for select PPH_ARR_AMOUNT,PPH_LOP_AMOUNT,PPH_LOPR_AMOUNT 
       from PRM_P_HOP 
       where PPH_HOP_CODE=HOP;
    RETURN get_hop_cursor;
    END IF;
    END PRM_FN_GETHOP;
    Thank you and best regards,

    user10422719 wrote:
    Hello...

    of course... they are...!

    the fn must have two the HOP and process
    By pressing the Fn with a null value for the process... it must perform a select operation that chooses only one record
    else... He must select three columns of a record...

    any thoughts on the use of case?

    The function can return only one type of data. If 'a record' is the same structure as the "a record", then you can return to this structure, but if they are different, then the function is expanded wrongly.

    If you use a package, you can overload your name of the function so that it recognizes when parameters are passed in and then each of the functions can return different types...

    SQL> ed
    Wrote file afiedt.buf
    
      1  create or replace package test_pkg as
      2    function get_emps(p_deptno IN NUMBER, p_processfor IN NUMBER) return number;
      3    function get_emps(p_deptno IN NUMBER) return sys_refcursor;
      4* end;
    SQL> /
    
    Package created.
    
    SQL> ed
    Wrote file afiedt.buf
    
      1  create or replace package body test_pkg as
      2    function get_emps(p_deptno IN NUMBER, p_processfor IN NUMBER) return number is
      3      v_sum number;
      4    begin
      5      select sum(sal)
      6      into v_sum
      7      from emp
      8      where deptno = p_deptno;
      9      return v_sum;
     10    end;
     11    function get_emps(p_deptno IN NUMBER) return sys_refcursor is
     12      v_rc sys_refcursor;
     13    begin
     14      open v_rc for 'select sal from emp where deptno = '||p_deptno;
     15      return v_rc;
     16    end;
     17* end;
    SQL> /
    
    Package body created.
    
    SQL> var emp_sum number;
    SQL> exec :emp_sum := test_pkg.get_emps(30,0);
    
    PL/SQL procedure successfully completed.
    
    SQL> print :emp_sum;
    
       EMP_SUM
    ----------
          9400
    
    SQL> var emp_recs refcursor;
    SQL> exec :emp_recs := test_pkg.get_emps(30);
    
    PL/SQL procedure successfully completed.
    
    SQL> print emp_recs;
    
           SAL
    ----------
          1600
          1250
          1250
          2850
          1500
           950
    
    6 rows selected.
    
    SQL>
    
  • How to set the result of the dynamic query in a refcursor ON param.

    Hello

    I created the following package.

    CREATE OR REPLACE package LGIS
    Is

    Type T_Cust_Acct_Arr is table of number;

    Type Invc_Base_Rec_Type is (Record
    Invoice_Control_No Customer_History.Invoice_Control_No%Type,
    Billing_Cycle_Id Eb_Oor_Cust_Online.Billing_Cycle_Id%Type,
    Bill_Cycl_Occr_No Eb_Oor_Cust_Online.Bill_Cycl_Occr_No%Type,
    Invoice_Dt Bill_Cycl_Occr_Inf.Invoice_Date%Type,
    Invc_Acct_Id Eb_Oor_Cust_Online.Customer_Acct_Id%Type,
    Acct_Id Eb_Oor_Cust_Online.Customer_Acct_Id%Type
    );

    Type Invc_Base_Refcur_Type is Ref Cursor
    Return Invc_Base_Rec_Type;

    Procedure P_Get_Approved_Whole_Invcs)
    In_From_Invc_Dt by Date,
    In_To_Invc_Dt by Date,
    In_Cust_Acct_List in T_Cust_Acct_Arr,
    Out_Eb_Invcs on Invc_Base_Refcur_Type
    On_Error_No number
    );

    End LGIS;
    /

    CREATE OR REPLACE PACKAGE BODY Lgis
    IS

    PROCEDURE P_Get_Approved_Whole_Invcs)
    In_From_Invc_Dt BY DATE,
    In_To_Invc_Dt BY DATE,
    In_Cust_Acct_List IN T_Cust_Acct_Arr,
    Out_Eb_Invcs on Invc_Base_Refcur_Type
    On_Error_No NUMBER
    )
    IS
    S_Query VARCHAR2 (4000);
    Invalid_Exception EXCEPTION;


    BEGIN
    On_Error_No: = 0;

    IF In_Cust_Acct_List.COUNT > 0 THEN
    FORALL i IN 1.In_Cust_Acct_List.COUNT
    INSERT INTO EB_CUST_ACCT_WHOLE_TMP (Cust_Acct_Val)
    VALUES (In_Cust_Acct_List (i));
    END IF;


    BEGIN
    S_Query: = 'Select Ch.Invoice_Control_No,';
    S_Query: = S_Query | ' Eoco.Billing_Cycle_Id,';
    S_Query: = S_Query | ' Eoco.Bill_Cycl_Occr_No,';
    S_Query: = S_Query | ' Bcoi.Invoice_Date,';
    S_Query: = S_Query | ' Eoco.Customer_Acct_Id as Invc_Acct_Id';
    S_Query: = S_Query | ' Eoco.Customer_Acct_Id as Acct_Id ';
    S_Query: = S_Query | "Of Eb_Oor_Cust_Online Eoco,';
    S_Query: = S_Query | "Customer_History Ch';
    S_Query: = S_Query | ' Bcoi Bill_Cycl_Occr_Inf,';
    S_Query: = S_Query | "Audit_Var_Log Avl,';
    S_Query: = S_Query | "Audit_Var_Def Avd,';
    S_Query: = S_Query | "Eb_Cust_Acct_Whole_Tmp Tmp';
    S_Query: = S_Query | "Where Avd.Audit_Var_Cd ="CYCLE_APPROVAL"';
    S_Query: = S_Query | ' And Avl.Audit_Var_Sub_Grp_Val = 0';
    S_Query: = S_Query | "And Avl.Audit_Var_Char_Val =" COMPLETE "';
    S_Query: = S_Query | ' And Eoco.Customer_Acct_Id = Tmp.Cust_Acct_Val';
    S_Query: = S_Query | ' And Eoco.Customer_Acct_Id = Ch.Customer_Acct_Id';
    S_Query: = S_Query | ' And Eoco.Billing_Cycle_Id = Ch.Billing_Cycle_Id';
    S_Query: = S_Query | ' And Eoco.Bill_Cycl_Occr_No = Ch.Bill_Cycl_Occr_No';
    S_Query: = S_Query | ' And Eoco.Billing_Cycle_Id = Bcoi.Billing_Cycle_Id';
    S_Query: = S_Query | ' And Eoco.Bill_Cycl_Occr_No = Bcoi.Bill_Cycl_Occr_No';
    S_Query: = S_Query | ' And Avd.Audit_Var_Id = Avl.Audit_Var_Id';
    S_Query: = S_Query | ' And Avl.Audit_Var_Grp_Id = Bcoi.Audit_Var_Grp_Id';


    IF (In_From_Invc_Dt IS NULL AND In_To_Invc_Dt IS NOT NULL) THEN
    S_Query: = S_Query | "And Bcoi.Invoice_Date < = In_To_Invc_Dt';
    END IF;

    IF (In_To_Invc_Dt IS NULL AND In_From_Invc_Dt IS NOT NULL) THEN
    S_Query: = S_Query | ' And Bcoi.Invoice_Date > = In_From_Invc_Dt';
    END IF;

    IF (In_From_Invc_Dt IS NOT NULL AND In_To_Invc_Dt IS NOT NULL) THEN
    S_Query: = S_Query | ' And Bcoi.Invoice_Date > = In_From_Invc_Dt';
    S_Query: = S_Query | "And Bcoi.Invoice_Date < = In_To_Invc_Dt';
    END IF;


    RUN IMMEDIATELY S_Query IN Out_Eb_Invcs;
    EXCEPTION
    WHILE OTHERS THEN
    On_Error_No: = - 1;
    RAISE Invalid_Exception;
    END;
    Exception
    When Invalid_Exception then
    On_Error_No: = - 1;
    Return;
    While others then
    On_Error_No: = - 1;
    END P_Get_Approved_Whole_Invcs;
    Lgis END;
    /

    It compiles without error. But at runtime, I get the following error:

    ORA-06504: PL/SQL: return variables of the game results or the query types do not match

    Please help solve this problem.

    Thank you
    Olivier

    Maybe it will work for you too->

    CREATE OR REPLACE Package Body Lgis
    Is
         Procedure P_Get_Approved_Whole_Invcs
         (
              In_From_Invc_Dt In Date,
              In_To_Invc_Dt In Date,
              In_Cust_Acct_List In T_Cust_Acct_Arr,
              Out_Eb_Invcs Out Invc_Base_Refcur_Type,
              On_Error_No Out Number
         )
         Is
              S_Query Varchar2(4000);
              Invalid_Exception Exception;
         Begin
              On_Error_No := 0;
    
              If In_Cust_Acct_List.Count > 0 Then
                   Forall I In 1..In_Cust_Acct_List.Count
                   Insert Into Eb_Cust_Acct_Whole_Tmp (Cust_Acct_Val)
                   Values (In_Cust_Acct_List (I));
              End If;
    
              Begin
                   S_Query := '     Select      Ch.Invoice_Control_No Invoice_Control_No, '
                            ||'                 Eoco.Billing_Cycle_Id Billing_Cycle_Id, '
                            ||'                 Eoco.Bill_Cycl_Occr_No Bill_Cycl_Occr_No, '
                            ||'                Bcoi.Invoice_Date Invoice_Dt, '
                            ||'                Eoco.Customer_Acct_Id As Invc_Acct_Id,'
                            ||'                Eoco.Customer_Acct_Id As Acct_Id '
                            ||'     From      Eb_Oor_Cust_Online Eoco, '
                            ||'                Customer_History Ch, '
                            ||'                Bill_Cycl_Occr_Inf Bcoi, '
                            ||'                Audit_Var_Log Avl, '
                            ||'                Audit_Var_Def Avd, '
                            ||'                Eb_Cust_Acct_Whole_Tmp Tmp '
                            ||'     Where      Avd.Audit_Var_Cd = '||chr(39)||'CYCLE_APPROVAL'||chr(39)
                            ||'     And      Avl.Audit_Var_Sub_Grp_Val = 0 '
                            ||'     And      Avl.Audit_Var_Char_Val = '||chr(39)||'COMPLETE'||chr(39)
                            ||'     And      Eoco.Customer_Acct_Id = Tmp.Cust_Acct_Val '
                            ||'     And      Eoco.Customer_Acct_Id = Ch.Customer_Acct_Id '
                            ||'     And      Eoco.Billing_Cycle_Id = Ch.Billing_Cycle_Id '
                            ||'     And      Eoco.Bill_Cycl_Occr_No = Ch.Bill_Cycl_Occr_No '
                            ||'     And      Eoco.Billing_Cycle_Id = Bcoi.Billing_Cycle_Id '
                            ||'     And      Eoco.Bill_Cycl_Occr_No = Bcoi.Bill_Cycl_Occr_No '
                            ||'     And      Avd.Audit_Var_Id = Avl.Audit_Var_Id '
                            ||'     And      Avl.Audit_Var_Grp_Id = Bcoi.Audit_Var_Grp_Id '
    
                   If (In_From_Invc_Dt Is Null And In_To_Invc_Dt Is Not Null) Then
                        S_Query:=S_Query||'     And Bcoi.Invoice_Date <= In_To_Invc_Dt ';
                   End If;
    
                   If (In_To_Invc_Dt Is Null And In_From_Invc_Dt Is Not Null) Then
                        S_Query:=S_Query||'     And Bcoi.Invoice_Date >= In_From_Invc_Dt ';
                   End If;
    
                   If (In_From_Invc_Dt Is Not Null And In_To_Invc_Dt Is Not Null) Then
                        S_Query:=S_Query||'     And Bcoi.Invoice_Date >= In_From_Invc_Dt '
                                        ||'     And Bcoi.Invoice_Date <= In_To_Invc_Dt ';
                   End If;
    
                   Dbms_Output.Put_Line ('Test');
                   Open Out_Eb_Invcs For S_Query;
                   Dbms_Output.Put_Line ('Test1');
                   Loop
                        Fetch Out_Eb_Invcs Into Ibrt_Type;
                        Exit When Out_Eb_Invcs%notfound;
                        Dbms_Output.Put_Line ('Invoice_Control_No: ' || Ibrt_Type.Invoice_Control_No);
                        Dbms_Output.Put_Line ('Billing_Cycle_Id: ' || Ibrt_Type.Billing_Cycle_Id);
                        Dbms_Output.Put_Line ('Bill_Cycl_Occr_No: ' || Ibrt_Type.Bill_Cycl_Occr_No);
                        Dbms_Output.Put_Line ('Invoice_Dt: ' || Ibrt_Type.Invoice_Dt);
                        Dbms_Output.Put_Line ('Invc_Acct_Id: ' || Ibrt_Type.Invc_Acct_Id);
                        Dbms_Output.Put_Line ('Acct_Id: ' || Ibrt_Type.Acct_Id);
                   End Loop;
                   Dbms_Output.Put_Line ('Test2');
                   Close Out_Eb_Invcs;
    
                   /* Exception
                   When Others Then
                   On_Error_No := -1;
                   Raise Invalid_Exception; */
              End;
         Exception
              When Invalid_Exception Then
                   On_Error_No := -1;
                   Return;
         /* When Others Then
         On_Error_No := -1; */
         End P_Get_Approved_Whole_Invcs;
    End Lgis;
    

    Your problem is now fixed.

    Kind regards.

    LOULOU.

  • Recently closed tabs/windows/sessions permanently grayed out, Firefox home page search does not more

    Running Firefox 26 and recently closed/windows tabs session restore menu items are grayed out and never activate, I can't even use the shortcut (ctrl + shift + t)

    Also, I noticed the search firefox homepage has now stopped working, by clicking find just does nothing and even little ads mozilla which would show under the search bar disappeared

    I thought it was a question the profile/malicious module so I did a reset, which didn't work, so I uninstalled, removed personal customizations in uninstalling and doing a new installation of firefox, always the same questions...

    Scanned my computer with an analysis of the deep system using bitdefender updated 2013, no virus

    I don't have install all my previous modules (adobe pdf creator was automatically it then reinstall started but disabled) and sessionstore in all values: config are default and correct

    Help, please!

    After you have uninstalled firefox, remove all traces of the registry and installed a disc, many scans for malware, spyware and anti-virus and scans even programs programs, registry cleaning, I found that there are no problems with my computer

    I then tried to install an older version of firefox (v20) hoping that would solve the problem, to my surprise, everything finally worked!
    so I've updated to v26 and nothing worked as above!
    Then I tried downgraded v25 and once again everything worked!

    Since I understand that the issue was NOT with my profile, extensions, plugins, settings or whatever it is my fault, there is a problem with firefox 26 and more!

    If someone has similar problems, I recommend that you install a previous version of firefox and see how it works, disable automatic updates if that helps the issue

  • Calls to procedures of database with IN/OUT params in the OFA Page

    Hello

    I have the following requirement, can anyone suggest as the best approach please.

    I have a contract with header page and the rows that will be stored in the custom tables.

    User needs features to copy, which will provide a copy of the current record with the new record (similar to copy the functionality of the simultaneous program).


    As soon as the user presses the copy function, it must call my backend pricedure copy_contract (p_old_contract_no in NUM
    p_new_contract_no OUT number
    p_ret_code OUT number
    p_err_msg OUT VARCHAR
    )

    Once it returns RETCODE contains 0, and p_err_msg is null, then I need open another page that displays p_new_contract_no.


    If one has done similar req. Please share the code.

    Thank you
    Mahesh

    Mahesh

    You can use Oracle callable statement to call the procedure of the OFA database. Please find the link to describe which

    http://oracleanil.blogspot.com/2009/04/itemqueryvoxml.html

    Thank you
    AJ

  • execution of the procedure with refcursor as output parameter

    Hi I have the package following a procedure with parameter as refcursor OUT.
    Here is an example of sample with the same structure with name in the other table, handling exceptions in my dev environment
    CREATE OR REPLACE PACKAGE TEST_PACK
      IS
    Type refCursor  is  REF CURSOR;
    PROCEDURE TEST_PROC (out_data out refCursor);
    END;
    
    
    CREATE OR REPLACE PACKAGE BODY TEST_PACK 
     IS
     Procedure test_proc (
            out_data out refCursor
                ) is
        --
        v_sql varchar2(4000);
       
        --
        begin
    
               v_sql := 'select
                        * from emp';
                       
            DBMS_OUTPUT.PUT_LINE ( 'Select Query is: '||v_sql );
    
            open out_data for v_sql;
    
            Exception
                when others then
                    DBMS_OUTPUT.PUT_LINE ( 'Error '|| SQLCODE ||','||SQLERRM );
    
       END;   
    end ;
    When I try to execute this procedure with the followig block
    DECLARE
       TYPE my_newcursor IS REF CURSOR;
       test_cur   my_newcursor;
      out_text      VARCHAR2 (4000);
    BEGIN
       TEST_PACK.test_proc(TEST_CUR) ;
       LOOP
          FETCH test_cur INTO out_text;    
          EXIT WHEN test_cur%NOTFOUND;
          dbms_output.put_line('Value of refcur is:'||out_text);
       END LOOP;
         CLOSE test_cur;  
    END;
    I get the following error
    ORA-00932: inconsistent datatypes: expected - got -
    ORA-06512: at line 8
    Could you please help me where I am doing wrong

    Thank you

    You must extract your data to an appropriate data type.

    (and note there is no need to declare your own ref cursor type as Oracle provides sys_refcursor at the end)

    for example

    SQL> set serverout on
    SQL>
    SQL> create or replace procedure test_proc(out_data out sys_refcursor) is
      2    v_sql varchar2(4000);
      3  begin
      4    v_sql := 'select * from emp';
      5    DBMS_OUTPUT.PUT_LINE ( 'Select Query is: '||v_sql );
      6    open out_data for v_sql;
      7  end;
      8  /
    
    Procedure created.
    
    SQL>
    SQL> declare
      2    rc     sys_refcursor;
      3    empRec emp%rowtype;
      4  begin
      5    test_proc(rc);
      6    loop
      7      fetch rc into empRec;
      8      exit when rc%notfound;
      9      dbms_output.put_line('Employee: '||empRec.empno||' - '||empRec.ename);
     10    end loop;
     11    close rc;
     12  end;
     13  /
    Select Query is: select * from emp
    Employee: 7369 - SMITH
    Employee: 7499 - ALLEN
    Employee: 7521 - WARD
    Employee: 7566 - JONES
    Employee: 7654 - MARTIN
    Employee: 7698 - BLAKE
    Employee: 7782 - CLARK
    Employee: 7788 - SCOTT
    Employee: 7839 - KING
    Employee: 7844 - TURNER
    Employee: 7876 - ADAMS
    Employee: 7900 - JAMES
    Employee: 7902 - FORD
    Employee: 7934 - MILLER
    
    PL/SQL procedure successfully completed.
    
    SQL>
    

    Why do you use a slider ref anyway?

    {: identifier of the thread = 886365}

  • Error won't let me go to another class (has got me pulling out my hair)

    Good buddies, so basically I have 2 buttons in the mainfraime class. The first button leads to the candidate page and the second page of voters. The first button works and redirects the user to the PasswordDemo page, but to the hell out of me I can't understand why he refuses to acknowledge the 'profile' class as its supposed to go to when the user clicks the second button. He keeps telling me that "the Profile() method is not defined for the Mainframe type. Help, please.

    Class mainframe:
    //The applications first or the main frame
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    
    public class Mainframe extends JFrame {
    
            private JButton myFirstButton;
            private JButton mySecondButton;
            private javax.swing.JButton jButton1;
            private javax.swing.JButton jButton2;
            private javax.swing.JLabel jLabel1;
            private javax.swing.JLabel jLabel2;
            private javax.swing.JLabel jLabel3;
    
            // Constructor for a new frame
    
            public Mainframe() {
    
                    super("Welcome Page");
                    
                    
    
                    myFirstButton = new JButton("Contestant");
                    myFirstButton.setFont(new Font( "Arial", Font.BOLD, 18));
                    myFirstButton.setBackground(Color.red);
    
                    mySecondButton = new JButton("Voter");
                    mySecondButton.setFont(new Font( "Arial", Font.BOLD, 18));
                    mySecondButton.setBackground(Color.ORANGE);
    
                    Container c = getContentPane();
                    FlowLayout fl = new FlowLayout(FlowLayout.LEFT);
                    c.setLayout(fl);
    
                    c.add (myFirstButton);
                    c.add (mySecondButton);
    
                    ButtonHandler handler = new ButtonHandler();    //creation of a new Object
                    myFirstButton.addActionListener(handler);          // Attach/register handler to myFirstButton
                    mySecondButton.addActionListener(handler);        //Attach/register handler to mySecondButton
    
                    setSize(400, 300);
                    show();
                    
           
            
            }
    
    
            public static void main(String [] args) {
    
                    // Make frame
                    Mainframe f = new Mainframe();
    
                    f.addWindowListener(
                            new WindowAdapter() {
                                    public void windowClosing(WindowEvent e) {
    
                                            // This closes the window and terminates the
                                            // Java Virtual Machine in the event that the
                                            // Frame is closed by clicking on X.
                                            System.out.println("Exit via windowClosing.");
                                            System.exit(0);
                                    }
                            }
                    );
            } // end of main
    
            // inner class for button event handling
            private class ButtonHandler implements ActionListener {
                    public void actionPerformed(ActionEvent e) {
                            if (e.getSource() == myFirstButton) {
                            
                                 PasswordDemo inputForm = new PasswordDemo();
                                    //inputForm.setVisible(true);
                                    
                                    try
                                    {
                                    PasswordDemo.createAndShowGUI();
                                    inputForm.setVisible(false);
                                    }
                                    
                                    catch(Exception d)
                                    {
                                         
                                    }
                                   // new PasswordDemo();
                            }
                            if (e.getSource() == mySecondButton) {
                                 
                           //     Profile p = Profile();
                                
                           //     p.setVisible(true);
                                  
                           }
                    }       
            }
            
            public void actionPerformed (ActionEvent e)
            {
                String cmd = e.getActionCommand();
    
                if (mySecondButton.equals(cmd)) {
                     boolean success=true; 
                     if(success)
                     {
                     Profile p = Profile();
                    
                       p.setVisible(true);
                
                     }
                     
                }
    
            
          //  private void mySecondButtonActionPerformed(java.awt.event.ActionEvent evt)
        //    {
         //        Profile p = Profile();
                
         //       p.setVisible(true);
         //   }
    
            
    } // end of outer class
    }
    Profile class:
    import java.awt.event.ActionListener;
    import java.sql.*;
    
    public class Profile extends javax.swing.JFrame {
    
        public Profile() {
            initComponents();
        }
    
        @SuppressWarnings("unchecked")
    
        private void initComponents() {
    
            titleLabel = new javax.swing.JLabel();
            nameAccess = new javax.swing.JLabel();
            ageAccess = new javax.swing.JLabel();
            heightAccess = new javax.swing.JLabel();
            weightAccess = new javax.swing.JLabel();
            lastNameAccess = new javax.swing.JLabel();
            descriptionAccess = new javax.swing.JLabel();
            nameLabel = new javax.swing.JLabel();
            lastNameLabel = new javax.swing.JLabel();
            ageLabel = new javax.swing.JLabel();
            heightLabel = new javax.swing.JLabel();
            weightLabel = new javax.swing.JLabel();
            descriptionLabel = new javax.swing.JLabel();
    
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    
            titleLabel.setFont(new java.awt.Font("Gungsuh", 1, 18)); // NOI18N
            titleLabel.setText("\"User\"'s Profile");
    
            nameAccess.setText("Name: ");
            nameLabel.setText("");
            
            lastNameAccess.setText("Last Name: ");
            lastNameLabel.setText("");
    
            ageAccess.setText("Age: ");
            ageLabel.setText("");
    
            heightAccess.setText("Height: ");
            heightLabel.setText("");
            
            weightAccess.setText("Weight: ");
            weightLabel.setText("");
            
            descriptionAccess.setText("Description: ");
            descriptionLabel.setText("");
            
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(titleLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 246, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(nameAccess)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(nameLabel))
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(lastNameAccess)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(lastNameLabel))
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(ageAccess)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(ageLabel))
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(heightAccess)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(heightLabel))
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(weightAccess)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(weightLabel))
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(descriptionAccess)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(descriptionLabel)))
                    .addContainerGap(151, Short.MAX_VALUE))
            );
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(titleLabel)
                    .addGap(13, 13, 13)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(nameAccess)
                        .addComponent(nameLabel))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(lastNameAccess)
                        .addComponent(lastNameLabel))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(ageAccess)
                        .addComponent(ageLabel))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(heightAccess)
                        .addComponent(heightLabel))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(weightAccess)
                        .addComponent(weightLabel))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(descriptionAccess)
                        .addComponent(descriptionLabel))
                    .addContainerGap(139, Short.MAX_VALUE))
            );
    
            pack();
        }// </editor-fold>
    
        /**
         * @param args the command line arguments
         */
        
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
    
                public void run() {
                    new Profile().setVisible(true);
                }
            });
        }
        // Variables declaration - do not modify
        private javax.swing.JLabel ageAccess;
        private javax.swing.JLabel ageLabel;
        private javax.swing.JLabel descriptionAccess;
        private javax.swing.JLabel descriptionLabel;
        private javax.swing.JLabel heightAccess;
        private javax.swing.JLabel heightLabel;
        private javax.swing.JLabel lastNameAccess;
        private javax.swing.JLabel lastNameLabel;
        private javax.swing.JLabel nameAccess;
        private javax.swing.JLabel nameLabel;
        private javax.swing.JLabel titleLabel;
        private javax.swing.JLabel weightAccess;
        private javax.swing.JLabel weightLabel;
        // End of variables declaration
    }
    Class PasswordDemo:
    import javax.swing.*;
    import java.sql.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.Arrays;
    import java.net.*;
    import java.io.*;
    import java.util.Scanner;
    
    public class PasswordDemo extends JPanel
                              implements ActionListener  {
        private static String OK = "ok";
        private static String HELP = "help";
        private static String Register = "Register";
    
        private JFrame controllingFrame; //needed for dialogs
        private JTextField username;
        private JPasswordField passreg;
        private JTextField usernamefield;
        private JPasswordField passwordField;
    
        private javax.swing.JButton jButton1;
        private javax.swing.JButton jButton2;
    
        private JTextField name;
        private JTextField age;
        private JTextField height;
        private JTextField weight;
    
     private javax.swing.JPanel jPanel1;
    
        private void gothere() {
    
                      JFrame f = new JFrame("This is a test");
                      f.setSize(400, 300);
                      Container content = f.getContentPane();
                      content.setBackground(Color.white);
                      content.setLayout(new FlowLayout());
                     // content.add(new JButton("Button 1"));
                      //content.add(new JButton("Button 2"));
                      //
    
    
    
             name = new JTextField("Please put your name here", 20);
              name.setFont(new Font("Serif", Font.PLAIN, 14));
              content.add(name);
    
              age = new JTextField("Please put your age here", 20);
              age.setFont(new Font("Serif", Font.PLAIN, 14));
              content.add(age);
    
              height = new JTextField("Please indicate your height here", 20);
              height.setFont(new Font("Serif", Font.PLAIN, 14));
              content.add(height);
    
              weight = new JTextField("Please indicate your weight here", 20);
              weight.setFont(new Font("Serif", Font.PLAIN, 14));
              content.add(weight);
    
              content.add(new JButton("Submit"));
    
    
               f.setVisible(true);
        }
    
    
         public PasswordDemo(JFrame f) throws Exception {
            //Use the default FlowLayout.
            controllingFrame = f;
    
            //Create everything.
            usernamefield = new JTextField(10);
            usernamefield.setActionCommand(OK);
            usernamefield.addActionListener(this);
    
            passwordField = new JPasswordField(10);
            passwordField.setActionCommand(OK);
            passwordField.addActionListener(this);
    
            passreg = new JPasswordField(10);
            passreg.setActionCommand(Register);
            passreg.addActionListener(this);
    
            username = new JTextField("This is a sentence", 20);
            username.setActionCommand(Register);
            username.addActionListener(this);
    
            JLabel reg = new JLabel("If you are a new contestant please register: \n");
            JLabel user = new JLabel("Username: \n");
            user.setLabelFor(username);
            JLabel pass = new JLabel("Password: \n");
            user.setLabelFor(passreg);
    
    
            JLabel label = new JLabel("Enter your username and password to log in: ");
            label.setLabelFor(usernamefield);
            label.setLabelFor(passwordField);
    
            JComponent buttonPane = createButtonPanel();
    
            //Lay out everything.
            JPanel textPane = new JPanel(new FlowLayout(FlowLayout.TRAILING));
            textPane.add(reg);
            textPane.add(user);
            textPane.add(pass);
            textPane.add(username);
            textPane.add(passreg);
    
            textPane.add(label);
            textPane.add(usernamefield);
            textPane.add(passwordField);
    
    
    
            add(textPane);
            add(buttonPane);
        }
    
        public PasswordDemo() {
              // TODO Auto-generated constructor stub
         }
    
    
         protected JComponent createButtonPanel() {
            JPanel p = new JPanel(new GridLayout(0,1));
            JButton okButton = new JButton("OK");
            JButton helpButton = new JButton("Help");
    
            JButton regButton = new JButton("Register");
    
            okButton.setActionCommand(OK);
            helpButton.setActionCommand(HELP);
            regButton.setActionCommand(Register);
            okButton.addActionListener(this);
            helpButton.addActionListener(this);
            regButton.addActionListener(this);
    
            p.add(okButton);
            p.add(helpButton);
            p.add(regButton);
    
            return p;
        }
    
        public void actionPerformed (ActionEvent e)
        {
            String cmd = e.getActionCommand();
    
            if (OK.equals(cmd)) { //Process the password.   
    
                boolean success=true;                        //Sign In
    
                 String Username="";
                 String Password="";
                 
                 Username = this.usernamefield.getText();
                 Password = this.passwordField.getText();
    
                 try
                 {
                     success=check2(Username,Password);
                }
    
                 catch(Exception d)
                 {
                      System.out.println("Got out");
    
                 }     
    
    
                 if(success)
                 {
                 JOptionPane.showMessageDialog(controllingFrame, "Sign in Successful");
                 
                 
                 Form F = new Form(Username);
                 
                 F.setVisible(true);
                 
                 
                 }
                 else
                 JOptionPane.showMessageDialog(controllingFrame, "Sign in was unsuccessful");     
    
            }
    
            else if(HELP.equals(cmd)) { //The user has asked for help.
                JOptionPane.showMessageDialog(controllingFrame,
                    "You can get the password by searching this example's\n"
                  + "source code for the string \"correctPassword\".\n"
                  + "Or look at the section How to Use Password Fields in\n"
                  + "the components section of The Java Tutorial.");
            }
    
            else if(Register.equals(cmd)) {  //*****************************************************
                 boolean success=true;
    
                 String Username="";
                 String Password="";
    
    
    
                 Username = this.username.getText();
                 Password = this.passreg.getText();
    
    
    
                 try
                 {
                      success=check(Username,Password);
                 }
    
                 catch(Exception d)
                 {
                      System.out.println("Something bad happened");
    
                 }
    
    
                 if(success)
                 JOptionPane.showMessageDialog(controllingFrame, "Registration successful");
    
                 else
                 JOptionPane.showMessageDialog(controllingFrame, "Registration was unsuccessful");
    
    
            }
        }
    
        //Must be called from the event dispatch thread.
        protected void resetFocus() {
            passwordField.requestFocusInWindow();
        }
    
        static void createAndShowGUI() throws Exception {
            //Create and set up the window.
            JFrame frame = new JFrame("Registration Page");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    
            //Create and set up the content pane.
            final PasswordDemo newContentPane = new PasswordDemo(frame);
            newContentPane.setOpaque(true); //content panes must be opaque
            frame.setContentPane(newContentPane);
    
            //Make sure the focus goes to the right component
            //whenever the frame is initially given the focus.
            frame.addWindowListener(new WindowAdapter() {
                public void windowActivated(WindowEvent e) {
                    newContentPane.resetFocus();
                }
            });
    
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        }
        public static void main(String args[]) {
            //Schedule a job for the event dispatch thread:
            //creating and showing this application's GUI.
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    //Turn off metal's use of bold fonts
              UIManager.put("swing.boldMetal", Boolean.FALSE);
              try{
              createAndShowGUI();
              }
    
                catch(Exception e)
                {
    
                }
                }
                     });
                 }
    
        public void sendUserPass(String user,String pass)throws Exception
        {
    
             //Send request
    
    
             Class.forName("com.mysql.jdbc.Driver");
    
              Connection con = DriverManager.getConnection("jdbc:mySql://localhost:3306/Contest","root","");
    
              System.out.println("connected :D:D:D:D");
    
              PreparedStatement state = con.prepareStatement("Insert Into Contestant (USERNAME,PASSWORD) values ('"+user+"','"+pass+"')");
    
              state.executeUpdate();
    
              /*while(Result.next())
              {
                   System.out.println(Result.getString(1)+"\t"+Result.getString(2));
    
              }*/
    
              //server should reply by updating database
        }
    
    
        public boolean check(String user,String pass)throws Exception
        {
    
             //Send request
             Socket Sock = new Socket ("LocalHost",5000);
             
             DataOutputStream toServer = new DataOutputStream(Sock.getOutputStream());
             BufferedReader buff = new BufferedReader(new InputStreamReader(Sock.getInputStream()));
             
             String sentence="";
             
             toServer.writeBytes("1\n");
             
             sentence=buff.readLine();
             
             System.out.println(sentence+"\n");
             
             toServer.writeBytes(user+" "+pass+"\n");
             
             String answer="";
             
             answer = buff.readLine();
             
             if(answer.equals("No"))
                  return false;
             
             return true;
      
             /*Class.forName("com.mysql.jdbc.Driver");
    
              Connection con = DriverManager.getConnection("jdbc:mySql://localhost:3306/Contest","root","");
    
              System.out.println("connected :D:D:D:D");
    
              PreparedStatement state = con.prepareStatement("Select Username From Contestant where '"+user+"'= username");
    
              ResultSet Result = state.executeQuery();
    
              if(!Result.next())
              return true;*/
    
              
    
              //server should reply by updating database
        }
        
        
        public boolean check2(String user,String pass)throws Exception
        {
             Socket Sock = new Socket("localhost",5000);
             
             DataOutputStream toServer = new DataOutputStream (Sock.getOutputStream());
             BufferedReader buff = new BufferedReader(new InputStreamReader(Sock.getInputStream()));
             
             toServer.writeBytes("2\n");
             
             System.out.println("Well I sent the message");
             
             String sentence = buff.readLine();
             
             toServer.writeBytes(user+" "+pass+"\n");
             
             System.out.println(sentence);
             
             sentence=buff.readLine();
             
             System.out.println(sentence+"\n");
             
             
             if(sentence.equals("No"))
                  return false;
             
             return true;
        }
    
    
    }
    Profile p = Profile();
    

    Who says "call a 'Profile' method name that is defined in the current class"

    Maybe what you mean is:

    Profile p = new Profile();
    

    who says "create a new instance of the profile class and invoke its no. - arg constructor."

  • Roll on the text occasionally comment on erratic results, for example, first highlighted word and then no other product even if the mouse has not been published.  How can I fix it?

    I have Acrobat Pro DC and Windows 10.  When you try to make editing comments, I find almost impossible to get the words marked (by rolling on it with the mouse button).  The blue highlight climbs around the word to Word or closed unexpectedly after rolling on a single word, even if the mouse button was released.

    In addition, now that the strike and replacement tool has been eliminated, you are supposed to perform the same operation on the text to replace and, once the text highlighted blue, simply start typing the new text.  It works not.  After finally getting the right text marked, I start typing, and nothing happens.  I might have to select a tool (for example, strike-out), use and remove the strike-out, before the operation crossed out - replace works again.

    I have used earlier versions of Acrobat Pro (on Vista) without such problems.

    The problem I described with text selection was not with Acrobat, but rather with a failing wireless mouse.  Replacing the mouse seems to have resolved.  See erratic mouse, by selecting the problem of text - Logitech Forums

  • What should I do if "Recently closed Windows" shows nothing?

    Today, I came across a very unusual problem. I was surfing the web and click on a url and it said to open it in a new tab. Instead of display 'Sign in', he showed a tab that was totally Virgin I clicked several times more and I duplicated the process. In addition, the X to close the tabs had disappeared as well. Not sure what to do I just closed the window entirely. I had a second window open, so I had to still Firefox will. When I flew over "Recently closed tabs", he showed the closed tabs that came from the second window in the box that pops out. I thought that 'Ok, everything looks very good." I then on "Recently closed Windows" and absolutely nothing jumped out. No box or anything like that. I tried to restart, but got the same result. I even tried to open a new window and go to something in the Favorites and closed the window. Still nothing.

    This has me very confused.

    I use Firefox on Ubuntu 14.04.2 39.0

    After a few farm unexpectedly launches of Firefox and it suddenly works again. Very strange.

  • How can I restore my tabs closed

    Please forgive me if I do not exactly everything well it is my first time so if you need information out just answer and wrong type an answer for my problem as the title says I can not my tabs, once that I close them recently closed tabs, history option is grayed out so it wont work when I click on it and restore the session seems to work because every time I farm fire fox and it restore session he brings back the tabs that I used it also records the windows recently closed, it's just recently closed tabs that are the problem I checked the other issues, but they don't seem to have the answers I need please tell me if find you out how to recover my tabs

    Well, in theory, features such as Protection from surf to the CSA will be lock settings and restore them if they are changed, then you could Explorer if it actually works.

    With professional users in mind, Firefox has a feature to block certain parameters so that they cannot be overridden. This involves the creation of a couple of different files in the Firefox program folder (under C:\Program Files (x 86) \). I have not tried it myself, but you can learn more about here:

  • I want Firefox to log out of the sites automatically when I close firefox. He used to do this.

    Previously, Mozilla Firefox would sign for me automatically when I closed Firefox. For example, if I was connected to Yahoo, he would sign for me when I closed Firefox.

    After the last update, this feature has disappeared.

    I would like to take back. How?

    If you reopen sites automatically on next start then Firefox stores cookies which are used in these tabs in the file sessionstore.js as part of session data, if you download disconnected if you close Firefox without close tabs first.

    You can set the browser.sessionstore.privacy_level pref 2 (never) or 1 (not HTTPS) on the topic: config page to disable the registration of cookies via session restore.

    The browser.sessionstore.privacy_level_deferred pref is used when you do not reopen last session automatically via "show my windows and tabs from last time" and use the same values.

  • Qosmio F10: end strange message program all in closed system

    I use qosmio F-10, when I stopped my machine it refuses leaving message of END of program "Some Applications do not react" or "Win32 encounters an error which should be closed.

    for example, he gives this SMax4PNP is unresponsive, I finished this request by the Task Manager, but he gave another application that is not responding. Finally, I chose to click 'END NOW'. Then it took a long time to shut down the system

    Help, please

    Hello

    A lot of different programs and processes are running in the background. Obviously some of them won t be stopped. Try to detect applications that are a problem. If there are some of them that you need not of all utility configuration system under the Startup tab, you can check. There are all the applications listed that starts at the start of process. Remove the check mark in front of registered application startup item will be disabled.

    Good bye

  • The value of charset-params Weblogicv12

    Hi guys! I'm deployment artifact to the format of the war . It has parameters in the weblogic.xml file. In this file I added the tag charset params for example:

    < charset params >

    < input-charset >

    > resource path < / * < / resource-path >

    < java-charset name > UTF-8 < / java-charset-name >

    < / input-charset >

    < / charset params >

    The deployment completed successfully!

    But, when I build artifacts ear with the war (the war has the same charset params parameter in weblogic.xml file)

    then during the deployment process, I get following error:

    Caused by: weblogic.descriptor.DescriptorException: VALIDATION of the PROBLEMS have BEEN FOUND

    problem: cvc-complex - type. 2.4 b: element not allowed: charset params @ http://xmlns.Oracle.com/WebLogic/WebLogic-Web-app in the weblogic-web-app element @ http://xmlns.oracle.com/weblogic/weblogic-web-app: < null >

    to weblogic.descriptor.internal.MarshallerFactory$ 1.evaluateResults(MarshallerFactory.java:245)

    to weblogic.descriptor.internal.MarshallerFactory$ 1.evaluateResults(MarshallerFactory.java:231)

    to weblogic.descriptor.internal.MarshallerFactory$ 1.createDescriptor(MarshallerFactory.java:155)

    at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDescriptorManager.java:325)

    at weblogic.application.descriptor.AbstractDescriptorLoader2.getDescriptorBeanFromReader(AbstractDescriptorLoader2.java:803)

    Truncated. check the log file full stacktrace

    How can I use charset params parameter in the latter case?

    Thanks for the help everyone!

    I found the decision.

    In the second case, I had only not to use charset params. Instead it I use setting webapp.encoding.default (search by this title: things application.xml deployment descriptor - weblogic) in weblogic - application.xml example:

    WebApp.Encoding.default

    UTF-8

    Note: This settings I added in weblogic - application.xml for ear artifact

  • Can not get SOAP examples to work in the console - always get "undefined".

    First of all, I am a newbie to use SOAP in general.  I was able to write a php client and a service that worked on my localhost (using WAMP) in order to get the results of a database by using a function call.  Then I tried to make it work on a PDF file on my computer (Windows 10 using Acrobat DC Pro).

    I started by trying to run some basic examples taken from "The Javascript developer's Guide", by using the console and replacing it with my own values.  But he always returned with "undefined".  So I thought I'd just follow the examples set out but had the same problem.  Since then, I've been all over the Web, look at the examples and problems of others. But I've always defined when I run the - despite other people who say this has worked for them!

    I suspect that I use the incorrect URL since it is absent in most of the examples.  In any case, using the example of base below.

    I hope that someone can point out what I am doing wrong:

    cURL var = " " http://www.whitemesa.com/interop/InteropTest.WSDL ";

    var myProxy = SOAP.connect (cURL);

    var testString = "This is a test string.";

    var result = myProxy.echoString (testString);

    Console.println ("result is" + result);

    Thanks a lot for your time,.

    Mike

    I realized what I was doing wrong in general: I was wrong with the console!  In reviewing the guide on executing code on the console (multiple lines), it states:

    In order to evaluate several lines of code, highlight the

    lines and press the Enter button on the digital

    keyboard or press Ctrl + Enter.

    I was hitting just Ctrl + Enter without bringing out the lines to run the first.  However, my sample code still did not work when I run it.  I'm fairly certain it has to do with the used cURL, because the result says "echoString is not a function".  So I hope that someone can provide a correct URL if other trouble like me with examples may benefit from.

    On a brighter note for my initial concern, I could get my PHP localhost to the recognized console service.  For anyone curious what that looks like, see the following topics:

    SOAP.wireDump = false;

    var myProxy = SOAP.connect ("http://localhost:8080/demo/service.php?wsdl");

    var testString = 'Quality Assurance form X';

    var result = myProxy.getForm_QAPersonnelTbl (testString);

    Console.println ("Result is" + result.fullName); The result is Michael Faggard

    true

    Note that my localhost using the port "8080" and is the reason why it is in the URL.

Maybe you are looking for