Modfiying SQL in a viewObject in a differenat frame

I wish to collect information from one frame and display the results of a query in another frame.
My initial idea was to generate an event when the submit bottom was pressed, modify the SQL in the viewObject in the eventHandler class and then have that viewObject displayed in the results frame.
Do I put the event in the .uix for the entire page or just in the .uix for the individual frame.
How do I get the viewObject? Right now it is scoped in the results frame.
How do I modify the SQL query by appending a where clause?
I can not find an example in the docs. If there is, please tell me where.
Regards,
Bill

This falls in the the realm of answering my own question, but if the JDeveloper team could say right track / wrong track, I would appreciate it.
I wish to collect information from one frame and display the results of a query in another frame.
My initial idea was to generate an event when the submit bottom was pressed, modify the SQL in the viewObject in the eventHandler class and then have that viewObject displayed in the results frame.
Do I put the event in the .uix for the entire page or just in the .uix for the individual frame.Put the event in same frame(.uix) as the submit button.
How do I get the viewObject? Right now it is scoped in the results frame.Get the ViewObjecy from the ApplicationModule
From BC4J API
findViewObject
public ViewObject findViewObject(java.lang.String voName)
Finds the named View Object. The View Object name passed in (voName) may or may not be qualified with the name of the containing Application Module. If it is, the View Object name is said to be an AM-qualified View Object name. If not, the name is said to be an unqualified View Object name.
How do I modify the SQL query by appending a where clause?Use the method setWhereClause in the ViewObject class
From BC4J API
setWhereClause
public void setWhereClause(java.lang.String cond)
Sets a WHERE clause bind value of the View Object's query statement.
I can not find an example in the docs. If there is, please tell me where.I could not find an example in the docs for getting a ViewObject from the ApplicationModule, but I found one for
Creating and Changing View Object Queries in Code
Once again this is what I found and have not tested it yet. I believe it will work, but comments from the JDeveloper team would be appreciated.
Regards,
Bill

Similar Messages

  • Query problem  in viewobject wizard

    I have problem to viewobject creation
    In the sql Query of viewobject wizard, I can not use build-in sql function like trunc, nvl to the attribute
    if I use function, there is no problem with query test(query is valid). However when I click ok or apply button
    it popup message like this:
    "the following attributes will be set as transients. Derived expression will be lost"
    Does this mean I can not use any build-in fuction in select list in view obect wizard?
    Another question is how can I nest sql in the select list?
    for instance:
    in my select list in Query(viewobject wizard)
    I have Query:
    select Customer.CUSTOMER_ID,
    Customer.BANK_NUMBER,
    Customer.TRANS_AMOUNT,
    from CUSTOMER Customer
    where Customer.CUSTOMER_ID =:0
    it works without problem
    But if add nested select query:
    select Customer.CUSTOMER_ID,
    Customer.BANK_NUMBER,
    (select sum(c.TRANS_AMOUNT)
    from CUSTOMER c
    where......
    ) as "Amount"
    Account.FILE_NAME,
    from CUSTOMER Customer, ACCOUNT Account
    where Customer.CUSTOMER_ID =:0
    It did not work.
    Can somebody tell me how to solve this problem?
    Or is there another way to achieve this?
    thanks

    sory i wrote the wrong one
    function CF_ITEMFormula return number is
    v_item number(30);
    begin
    IF :P_state  ALL then
            IF :P_STATE = 'SMALL' THEN
            SELECT aa.item
            INTO v_item
            FROM tableA aa,
                     tableb bb
            WHERE aa.code = bb.code
            AND aa.date = :P_date
            AND aa.name = :P_name
            AND bb.state LIKE '%et%''
            AND (case :P_DIV
                    when ('west') then aa.division = 1
                    when ('east') then aa.division = 2
                    when ('south') then aa.division = 3
                    when ('south & west) then aa.division in (1,3)
                    else aa.division in (1,2,3)
                    end);
            end if;
           IF :P_STATE = 'BIG' THEN
            SELECT aa.item
            INTO v_item
            FROM tableA aa,
                     tableb bb
            WHERE aa.code = bb.code
            AND aa.date = :P_date
            AND aa.name = :P_name
            AND bb.state LIKE '%wa%''
            AND (case :P_DIV
                    when ('west') then aa.division = 1
                    when ('east') then aa.division = 2
                    when ('south') then aa.division = 3
                    when ('south & west) then aa.division in (1,3)
                    else aa.division in (1,2,3)
                    end);
            end if;
    end if;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN RETURN (0)
    end;

  • How to get resultset from viewobject

    is there a way to java.sql.ResultSet from ViewObject , i am using Jdev 10.1.3.4 with ADFBC
    Thanks

    I guess the answer is no.
    May I ask why you need a java.sql.ResultSet?
    Timo

  • Is it possible to remove Locks in SQL server 200 using java code...???

    Hi floks,
    I had i trickey situation in which my application is creating the locks over the tables in the
    DB(SQL server 2000) . Iam using Struts frame work 1.1 + jsp in our application.
    Iam bit worried wether the locks can be removed with the java code which suits the Struts
    framework...
    Please help me with proper code snippet to over come the situation.
    Thanks in anticipation
    Shiv

    iam looking to make a query in such a way that it can be triggered with
    java code whish removes all the locks
    is it possible...?
    i tried the nolock situation even i cant get the situations
    and the query where it is getting locked as our application is big enough with
    numerous number of queries

  • Wrap PL/SQL Error

    Hi all
    I try to encrypt a SQL file using Wrap uitility, But it give me an error
    as
    C:\>wrap iname=c:\script\accounts.sql
    the error is
    Kgepop:no error frame to pop to for error 1801
    My system is Windows2000 and oracle 9.2
    Thanks all

    RTFM [url http://oraclesvca2.oracle.com/docs/cd/B10501_01/appdev.920/a96624/c_wrap.htm#3221]Limitations of the Wrap Utility

  • Request for "WHERE  -   IN" Combination with Bind Variables.

    Hi,
    In ADF BC
    Im Creating the Bind Variables Searching methodolgy in ViewObject.
    SQL Editor:
    Query Like
    SELECT * FROM SEASON season WHERE season.MMYEAR IN (102007,112007) Here Done this query.
    In ViewObject Bind Variable Like B_MMYear .
    SQL Statement : SELECT season.Code,season.Location,season.MMYEAR FROM SEASON season already is there in SQL Statement in ViewObject
    Just im adding this conditon "WHERE season.MMYEAR IN (:B_MMYear)"
    after
    Drag&drop the ExecutewithParams form
    and im giving the MMYear like *102007,112008* then push ExecutewithParams....no Rows to Display...
    when im giving the only one vlaue like 102007 (Or ) 112007 then displays the suitable Row.
    how i can give the query Like "WHERE - IN" Combination in Bind Variables.
    Thanks,
    Rama.
    Edited by: user634195 on Oct 17, 2008 6:37 AM

    Thanks for rply Mr Timo.
    my BindVariable is not Numeric Type...it as a String. ok
    i already checks the debugging
    but i didn't get Exact Query
    query seems without Values same As SQL Statement in ViewOBject.
    like this
    SELECT season.Code,season.Location,season.MMYEAR FROM SEASON season WHERE season.MMYEAR IN (:B_MMYear)
    you Know...India Season of the Culture....
    see.
    In India Colture have Two Seasions
    1.Rabi.
    2.Kharif.
    example:
    Present Year : 2008 ok
    Rabi Season Strats from Oct2008 to March2009.
    Kharif Season Starts from Apr2008 to Sep2008.
    ok
    In my JSP Page one DropDown is there that is Season ok.
    when i select the Rabi....Then Rabi Months comes to page in CoreTable.
    i already done in DB:
    For Rabi:
    SELECT season.Code,season.Location,season.MMYEAR FROM SEASON season WHERE season.MMYEAR IN (10,11,12,01,02,03) done.
    For Kharif:
    SELECT season.Code,season.Location,season.MMYEAR FROM SEASON season WHERE season.MMYEAR IN (04,05,06,07,08,09) also done.
    the realtion b/w Bind Variable and Value....i think is somethink diff.
    Edited by: user634195 on Oct 17, 2008 7:50 AM

  • Why am I receiving Null pointer Exception Error.

    why am I receiving Null pointer Exception Error.
    Hi I am developing a code for login screen. There is no syntex error as such ut I am receving the aove mentioned error. Can some one please help me ??
    ------------ Main.java------------------
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    public class Main implements ActionListener
    Frame mainf;
    MenuBar mb;
    MenuItem List,admitform,inquiry,exit,helpn;
    Menu newm,update,help;
    Inquiry iq;
    Admit ad;
    // HosHelp hp;
    Howuse hu;
    Register reg;
    Main()
    mainf=new Frame(" Engg College V/S Mumbai University ");
         mb=new MenuBar();
         newm=new Menu(" New ");
         update=new Menu(" Update ");
         help=new Menu(" Help ");
         List=new MenuItem("List");
         admitform=new MenuItem("Admit");
         inquiry=new MenuItem("Inquiry");
         exit=new MenuItem("Exit");
         helpn=new MenuItem("How to Use?");
    newm.add(List);
                   newm.add(admitform);
    newm.add(inquiry);
                   newm.add(exit);
         help.add(helpn);
              mb.add(newm);
              mb.add(update);
              mb.add(help);
    mainf.setMenuBar(mb);
                   exit.addActionListener(this);
                   List.addActionListener(this);
         inquiry.addActionListener(this);
         admitform.addActionListener(this);
    helpn.addActionListener(this);
         mainf.setSize(400,300);
         mainf.setVisible(true);
    public void actionPerformed(ActionEvent ae)
    if (ae.getSource()==List)
              reg=new Register();
         if(ae.getSource()==inquiry)
         iq=new Inquiry();
    if(ae.getSource()==admitform)
         ad=new Admit();
              if(ae.getSource()==helpn)
              hu=new Howuse();
              if(ae.getSource()==exit)
         mainf.setVisible(false);
    public static void main(String args[])
              new Main();
    -------------Register.java---------------------------
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    public class Register implements ActionListener//,ItemListener
    Label id,name,login,pass,repass;
    Button ok,newu,cancel,check;
    Button vok,iok,lok,mok,sok; //buttons for dialog boxes
    TextField idf,namef,loginf,passf,repassf;
    Dialog valid,invlog,less,mismat,acucreat;
    Frame regis;
    Checkbox admin,limit;
    CheckboxGroup type;
    DBconnect db;
    Register()
         db=new DBconnect();
    regis=new Frame("Registeration Form");
              type=new CheckboxGroup();
              admin=new Checkbox("Administrator",type,true);
              limit=new Checkbox("Limited",type,false);
              id=new Label("ID :");
    name=new Label("Name :");
         login=new Label("Login :");
         pass=new Label("Password :");
         repass=new Label("Retype :");
    idf =new TextField(20); idf.setEnabled(false);
         namef=new TextField(30); namef.setEnabled(false);
    loginf=new TextField(30); loginf.setEnabled(false);
         passf=new TextField(30); passf.setEnabled(false);
         repassf=new TextField(30); repassf.setEnabled(false);
    ok=new Button("OK"); ok.setEnabled(false);
         newu=new Button("NEW");
    cancel=new Button("Cancel");
         check=new Button("Check Login"); check.setEnabled(false);
    vok=new Button("OK");
         iok=new Button("OK");
              lok=new Button("OK");
              mok=new Button("OK");
              sok=new Button("OK");
    valid=new Dialog(regis,"Login name is valid !");
         invlog=new Dialog(regis,"Login name already exist!");
         less=new Dialog(regis,"Password is less than six characters !");
    mismat=new Dialog(regis,"password & retyped are not matching !");
    acucreat=new Dialog(regis,"You have registered successfully !");
         regis.setLayout(null);
    //     regis.setBackground(Color.orange);
    valid.setLayout(new FlowLayout());
         invlog.setLayout(new FlowLayout());
         less.setLayout(new FlowLayout());
         mismat.setLayout(new FlowLayout());
    acucreat.setLayout(new FlowLayout());
    id.setBounds(35,50,80,25); //(left,top,width,hight)
    idf.setBounds(125,50,40,25);
    name.setBounds(35,85,70,25);
    namef.setBounds(125,85,150,25);
    login.setBounds(35,120,80,25);
    loginf.setBounds(125,120,80,25);
    check.setBounds(215,120,85,25);
         pass.setBounds(35,155,80,25);
    passf.setBounds(125,155,80,25);
    repass.setBounds(35,190,80,25);
    repassf.setBounds(125,190,80,25);
    admin.setBounds(35,225,100,25);
    limit.setBounds(145,225,100,25);
              ok.setBounds(45,265,70,25);
         newu.setBounds(135,265,70,25);
    cancel.setBounds(225,265,70,25);
         passf.setEchoChar('*');
    repassf.setEchoChar('*');
         regis.add(id);
         regis.add(idf);
    regis.add(name);
         regis.add(namef);
         regis.add(login);
         regis.add(loginf);
         regis.add(check);
    regis.add(pass);
         regis.add(passf);
    regis.add(repass);
         regis.add(repassf);
         regis.add(ok);
         regis.add(newu);
         regis.add(cancel);
    regis.add(admin);
         regis.add(limit);
    valid.add(vok);
         invlog.add(iok);     
         less.add(lok);
         mismat.add(mok);
    acucreat.add(sok);
    ok.addActionListener(this);
         newu.addActionListener(this);
    check.addActionListener(this);
    cancel.addActionListener(this);
         // limit.addItemListener(this);
         //admin.addItemListener(this);
              vok.addActionListener(this);
              iok.addActionListener(this);
         lok.addActionListener(this);
         mok.addActionListener(this);
         sok.addActionListener(this);
    regis.setLocation(250,150);
    regis.setSize(310,300);
    regis.setVisible(true);
         public void actionPerformed(ActionEvent ae)
         if(ae.getSource()==check)
              try{
                   String s2=loginf.getText();
    ResultSet rs=db.s.executeQuery("select* from List");
                        while(rs.next())
                   if(s2.equals(rs.getString(2).trim()))
    //                    invlog.setBackground(Color.orange);
                             invlog.setLocation(250,150);
                             invlog.setSize(300,100);
                   cancel.setEnabled(false);
    ok.setEnabled(false);
    check.setEnabled(false);
                        invlog.setVisible(true);
                             break;
                        else
                        //     valid.setBackground(Color.orange);
                             valid.setLocation(250,150);
                             valid.setSize(300,100);
                   cancel.setEnabled(false);
    ok.setEnabled(false);
    check.setEnabled(false);
                   valid.setVisible(true);
                        }catch(Exception e)
                   e.printStackTrace();
    if(ae.getSource()==newu)
         try{
              ResultSet rs=db.s.executeQuery("select max(ID) from List");
         while(rs.next())
    String s1=rs.getString(1).trim();
                   int i=Integer.parseInt(s1);
    i++;
                   String s2=""+i;
    idf.setText(s2);
                   newu.setEnabled(false);
                   namef.setText(""); namef.setEnabled(true);
              loginf.setText(""); loginf.setEnabled(true);
              passf.setText(""); passf.setEnabled(true);
              repassf.setText(""); repassf.setEnabled(true);
              ok.setEnabled(true);
                   check.setEnabled(true);
                   }catch(Exception e)
              e.printStackTrace();
         if(ae.getSource()==ok)
              try
              String s1=idf.getText();
              String s2=loginf.getText();
              String s3=passf.getText();
         String s4=repassf.getText();
         int x=Integer.parseInt(s1);
         int t;
         if(type.getSelectedCheckbox()==admin)
              t=1;
              else
              t=0;
    ResultSet rs=db.s1.executeQuery("select* from List");
                   while(rs.next())
                   if(s2.equals(rs.getString(2).trim()))
                        invlog.setBackground(Color.orange);
                        invlog.setLocation(250,150);
                        invlog.setSize(300,100);
                   cancel.setEnabled(false);
    ok.setEnabled(false);
    check.setEnabled(false);
                        invlog.setVisible(true);
                        break;
                   else
                        if (s3.length()<6)
                        less.setBackground(Color.orange);
                             less.setLocation(250,150);
                             less.setSize(300,100);
                   ok.setEnabled(false);
                        cancel.setEnabled(false);
                        check.setEnabled(false);
                        less.setVisible(true);
    else if(!(s3.equals(s4)))
                        mismat.setBackground(Color.orange);
                        mismat.setLocation(250,150);
                        mismat.setSize(300,100);
                        ok.setEnabled(false);
                        cancel.setEnabled(false);
                        check.setEnabled(false);
                        mismat.setVisible(true);
                        else
    db.s1.execute("insert into User values("+x+",'"+s2+"','"+s3+"',"+t+")");
                        acucreat.setBackground(Color.orange);
                        acucreat.setLocation(250,150);
                        acucreat.setSize(300,100);
                        regis.setVisible(false);
                        acucreat.setVisible(true);
                   }//else
              }//while
                   } //try
              catch(Exception e1)
              // e1.printStackTrace();
              if (ae.getSource()==cancel)
              regis.setVisible(false);
              if (ae.getSource()==vok)
              ok.setEnabled(true);
                   cancel.setEnabled(true);
    check.setEnabled(true);
                   valid.setVisible(false);
              if (ae.getSource()==iok)
              ok.setEnabled(true);
                   cancel.setEnabled(true);
    check.setEnabled(true);
                   invlog.setVisible(false);
              if (ae.getSource()==lok)
              less.setVisible(false);
                   cancel.setEnabled(true);
    ok.setEnabled(true);
    check.setEnabled(true);
              if (ae.getSource()==mok)
              mismat.setVisible(false);
                   cancel.setEnabled(true);
    ok.setEnabled(true);
    check.setEnabled(true);
    if (ae.getSource()==sok)
              acucreat.setVisible(false);
              ok.setEnabled(false);
                   newu.setEnabled(true);
                   regis.setVisible(true);
         public static void main(String args[])
         new Register();
    -----------DBConnect.java------------------------------------
    import java.sql.*;
    public class DBconnect
    Statement s,s1;
    Connection c;
    public DBconnect()
    try
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              c=DriverManager.getConnection("jdbc:odbc:Sonal");
              s=c.createStatement();
    s1=c.createStatement();
         catch(Exception e)
         e.printStackTrace();
    ----------Login.java----------------
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    public class Login implements ActionListener
    Frame log;
    Label login,pass;
    TextField loginf,passf;
    Button ok,cancel;
    Dialog invalid;
    Button iok;
    Register reg;
    DBconnect db;
    Main m;
    Login()
    db=new DBconnect();
         log=new Frame();
         log.setLocation(250,210);
         login=new Label("Login :");
    pass=new Label("Password :");
         loginf=new TextField(20);
         passf=new TextField(20);
         passf.setEchoChar('*');
         ok=new Button("OK");
         // newu=new Button("New User");
         cancel=new Button("CANCEL");
         iok=new Button(" OK ");
    invalid=new Dialog(log,"Invalid User!");
    //log.setBackground(Color.cyan);
    //log.setForeground(Color.black);
         log.setLayout(null);
         // iok.setBackground(Color.gray);
         invalid.setLayout(new FlowLayout());
         login.setBounds(35,50,70,25); //(left,top,width,hight)
         loginf.setBounds(105,50,100,25);
         pass.setBounds(35,85,70,25);
         passf.setBounds(105,85,70,25);
         ok.setBounds(55,130,70,25);
    // newu.setBounds(85,120,80,25);
    cancel.setBounds(145,130,70,25);
    log.add(login);
    log.add(loginf);
    log.add(pass);
    log.add(passf);
    log.add(ok);
    // log.add(newu);
    log.add(cancel);
         invalid.add(iok);//,BorderLayout.CENTER);
    ok.addActionListener(this);
    // newu.addActionListener(this);
    cancel.addActionListener(this);
         iok.addActionListener(this);
    log.setSize(300,170);
    log.setVisible(true);
    public void actionPerformed(ActionEvent a)
    if(a.getSource()==ok)
         try{
              String l=loginf.getText();
              String p=passf.getText();
              ResultSet rs=db.s.executeQuery("select * from List");
              while(rs.next())
              if(l.equals(rs.getString(2).trim())&& p.equals(rs.getString(3).trim()))
                        String tp=rs.getString(4).trim();
                             int tp1=Integer.parseInt(tp);
    log.setVisible(false);
    if(tp1==1)
                             m=new Main();
                        // m.List.setEnabled(true);
                             else
                             m=new Main();
                             m.List.setEnabled(false);
                        break;
    else
                   invalid.setBackground(Color.orange);
                   invalid.setSize(300,100);
                   invalid.setLocation(250,210);
                   cancel.setEnabled(false);
              ok.setEnabled(false);
                   invalid.setVisible(true);
                   }catch(Exception e1)
                   e1.printStackTrace();
         if (a.getSource()==cancel)
         log.setVisible(false);
         if (a.getSource()==iok)
         invalid.setVisible(false);
         loginf.setText("");
         passf.setText("");
         cancel.setEnabled(true);
    ok.setEnabled(true);
         public static void main(String[] args)
         new Login();
    -------------inquiry.java---------------------------------
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.util.Date;
    import java.text.*;
    import java.sql.*;
    public class Inquiry implements ActionListener
    Frame inqry;
    Label name,addr;
    TextField namef,addrf;
    Button ok,cancel,dok;
    Dialog invalid;
    Frame result; //Result of the inquiry....
    Label lrname,lraddr,lward,lrdate,lcdate;
    TextField rname,raddr,ward,rdate,cdate;
    Date d;
    DateFormat df;
    Button rok,rcancel;
    Dialog success;
    Button rdok;
    DBconnect db;
    Inquiry()
              db=new DBconnect();
              inqry=new Frame("Inquiry Form");
              inqry.setLayout(null);
    inqry.setBackground(Color.cyan);
              name=new Label(" NAME ");
              addr=new Label("ADDRESS");
              namef=new TextField(20);
              addrf=new TextField(20);
              ok=new Button("OK");
              cancel=new Button("CANCEL");
              dok=new Button("OK");
              invalid=new Dialog(inqry,"Invalid Name or Address !");
              invalid.setSize(300,100);
         invalid.setLocation(300,180);
              invalid.setBackground(Color.orange);
              invalid.setLayout(new FlowLayout());
    result=new Frame(" INQUIRY RESULT "); //Result Window......
    result.setLayout(null);
    result.setBackground(Color.cyan);
    lcdate=new Label(" DATE ");
         lrname=new Label(" NAME ");
    lraddr=new Label(" ADDRESS ");
         lward=new Label(" WARD ");
         lrdate=new Label(" ADMIT-DATE ");
    cdate=new TextField(10);
         rname=new TextField(20);
    rname.setEnabled(false);
         raddr=new TextField(20);
         raddr.setEnabled(false);
         ward=new TextField(20);
         ward.setEnabled(false);
         rdate=new TextField(10);
         rdate.setEnabled(false);
         cdate=new TextField(20);
         d=new Date();
         df=DateFormat.getDateInstance(DateFormat.MEDIUM,Locale.KOREA);
         cdate.setText(df.format(d));
         cdate.setEnabled(false);
    rok=new Button(" OK ");
         rcancel=new Button("CANCEL");
              name.setBounds(40,50,50,25);
    namef.setBounds(120,50,130,25);
    addr.setBounds(40,100,60,25);
    addrf.setBounds(120,100,80,25);
    ok.setBounds(60,145,70,25);
              cancel.setBounds(140,145,70,25);
              lcdate.setBounds(200,50,60,25); //Result Window......
    cdate.setBounds(270,50,80,25);      
    lrname.setBounds(35,85,70,25);
    rname.setBounds(140,85,180,25);
    lraddr.setBounds(35,120,80,25);
         raddr.setBounds(140,120,100,25);
    lward.setBounds(35,155,80,25);
    ward.setBounds(140,155,100,25);
    lrdate.setBounds(30,190,80,25);
    rdate.setBounds(140,190,80,25);
    rok.setBounds(70,240,70,25);
    rcancel.setBounds(170,240,70,25);
              inqry.add(name);
              inqry.add(namef);
              inqry.add(addr);
              inqry.add(addrf);
              inqry.add(ok);
              inqry.add(cancel);
    invalid.add(dok);
         result.add(lcdate); //Result Window......
         result.add(cdate);
              result.add(lrname);
              result.add(rname);
              result.add(lraddr);
              result.add(raddr);
              result.add(lward);
              result.add(ward);
              result.add(lrdate);
              result.add(rdate);
              result.add(rok);
              result.add(rcancel);
         ok.addActionListener(this);
         cancel.addActionListener(this);
         dok.addActionListener(this);
    rok.addActionListener(this); //Result Window......
         rcancel.addActionListener(this);
         inqry.setSize(280,180);
         inqry.setLocation(300,180);
         inqry.setVisible(true);
              result.setSize(400,280); //Result Window......
         result.setLocation(200,150);
         result.setVisible(false);
              public void actionPerformed(ActionEvent ae)
                   if(ae.getSource()==ok)
                   try
                             String nm=namef.getText();
                             String ad=addrf.getText();
                             inqry.setVisible(false);
                             ResultSet rs=db.s.executeQuery("select * from Billinformation");
                             while(rs.next())
                                  String nm1=rs.getString(2).trim();
                                  String ad1=rs.getString(3).trim();
                                  int k=0;
                                  if((nm1.equals(nm))&&(ad1.equals(ad)))
                             String adm=rs.getString(5).trim();
                             String wr=rs.getString(6).trim();
                             String bd=rs.getString(8).trim();
                                  String wrb=wr+"-"+bd;
    result.setVisible(true);
                                  rname.setText(nm1);
                             raddr.setText(ad1);
                             ward.setText(wrb);
                             rdate.setText(adm);
    k=1;
                                  break;
                                  }//if
                             else if(k==1)
                             invalid.setVisible(true);
                             }//while
    }//try
                             catch(Exception e)
                             e.printStackTrace();
                        } //getsource ==ok
                   if(ae.getSource()==cancel)
    inqry.setVisible(false);
                        if(ae.getSource()==rok) //Result Window......
                        namef.setText("");
                             addrf.setText("");
                             result.setVisible(false);
                        inqry.setVisible(true);
    if(ae.getSource()==rcancel)
    result.setVisible(false);
                        if(ae.getSource()==dok)
                        namef.setText("");
                             addrf.setText("");
                             invalid.setVisible(false);
                             inqry.setVisible(true);
         public static void main(String args[])
              new Inquiry();
    PLease Help me !!
    I need this urgently.

    can you explain what your program tries to do... and
    at where it went wrong..Sir,
    We are trying to make an project where we can make a person register in our data base & after which he/she can search for other user.
    The logged in user can modify his/her own data but can view other ppl's data.
    We are in a phase of registering the user & that's where we are stuck. The problem is that after the login screen when we hit register (OK- button) the data are not getting entered in the data base.
    Can u please help me??
    I am using "jdk1.3' - studnet's edition.
    I am waiting for your reply.
    Thanks in advance & yr interest.

  • CUSTOM REPORT PROBLEM - REP-1213

    I am a student trying to complete a project. I developed a
    "custom" report form which uses 5 tables to generate the report.
    I have entered the 'fields' at various locations on the report
    form and when I run the report I get the following error message:
    "REP-1213: Field 'client_id' references column 'CLIENT_ID' at a
    frequency below its group."
    I have presented this problem to my instructor who does not have
    a solution to resolve this problem for me. Is there a solution
    for this? Or ... does Oracle not allow for 'custom designing'
    of reports? How does someone develop a custom made invoice or
    other report for a client without encountering these problems?
    Anybody's assistance in this matter would be greatly appreciated.
    BO
    null

    Here is some information that may be of help. This is straight
    from Oracle. read the part on FREQUENCY ERRORS carefully.
    You may also retrieve this document from:
    otn home page --> support --> technicial bulletions -->
    sql*reportwriter --> 9006913.61
    P.S. reportwriter frames have kicked manny asses!!
    Good luck.
    Document ID: 9006913.61
    Title: Understanding Frames
    Revision Number 0
    Product: Oracle Reports
    Platform: GENERIC
    Abstract: This document provides a better
    understanding
    of frames and the layering concept.
    Also
    discusses frequency errors.
    Keywords: REPEATING;FRAME;VARIABLE;FIXED;EXPAND;
    CONTRACT;FREQUENCY;
    INTRODUCTION
    There are two types of frames: Repeating frames and non-repeating
    frames.
    Each is a visual representation of actual 3GL code that underlies
    the action
    of fetching and printing the rows selected from tables.
    Non-repeating frames
    act as containers and can be mapped back to the pseudocode: BEGIN
    and END.
    Repeating frames are representations of the Fetch Cycle and can
    be mapped to
    the pseudocode: WHILE NOT END OF TABLE and END WHILE.
    Graphically, frames are stacked one atop the other. This may not
    be
    immediately apparent. It is difficult to distinguish which frame
    is beneath
    another. A quick way to see the three-dimensional layering is to
    change the
    color of the frames. Make each frame a different color. This
    will create a
    three-dimensional effect as frames above will partially obscure
    those beneath
    it. You will also notice the layering structure when using the
    object
    navigator in Reports V2.5
    NON-REPEATING FRAMES
    Non-repeating frames are not record-related. They print as often
    as the
    object in which they are enclosed, or to which they are attached
    by an anchor.
    They do not have a print direction.
    REPEATING FRAMES
    Repeating frames are place holders for records. Repeating frames
    print once
    for each record of a group and control record-level formatting.
    Reports will
    generate one repeating frame for each group when you create a
    default layout.
    Reports will place containers of columns inside of the frames.
    Each repeating
    frame retrieves only one row in its fetch cycle for any one
    repetition. Until
    it is constrained by another frame, it will repeat itself until
    the while loop
    condition can no longer be satisfied.
    VERTICAL AND HORIZONTAL SIZING
    The Vertical Sizing of a repeating frame will default to FIXED if
    all the
    objects in the repeating frame are fixed. If the repeating frame
    encloses an
    object (e.g. field, frame) that grows, then the vertical sizing
    defaults to
    VARIABLE or EXPAND.
    FIXED
    If the Vertical Size of the frame is FIXED then the object's
    height is the
    same on each logical page, regardless of the size of the objects
    or data
    within it. Truncation of data may occur. The height of the
    object in the
    layout editor is the actual height of the object at runtime. No
    special
    symbol is indicated on the frame in the layout editor.
    VARIABLE
    If the frame's Vertical Sizing Attribute is VARIABLE and there is
    nothing
    below it, it collapses. For example, if it normally is four lines
    long and
    only one row is returned, then it will not print three blank
    lines but will
    actually collapse the output to one line. If you drag the
    position of the
    fields downward, the space above will not collapse because of the
    IMPLICIT
    ANCHOR. The object will expand or contract vertically to
    accommodate the
    objects or data within it. The height shown in the layout editor
    has no
    effect on the object's height at runtime. The vertical sizing
    attribute
    functions as if you used a combination of contract and expand. A
    diamond
    symbol is indicated on the frame in the layout editor.
    EXPAND
    If the frame's Vertical Sizing Attribute is set to EXPAND, it
    will begin at a
    minimum size defined by the frame, and will expand as necessary
    to accommodate
    more data or lines that exceed the length of the column. An
    equal sign symbol
    is indicated on the frame in the layout editor.
    CONTRACT
    If the frame's Vertical Sizing Attribute is set to CONTRACT, the
    vertical size
    of the object decreases if the formatted objects or data within
    it are short
    enough, but it cannot increase to accommodate larger data.
    Truncation may
    occur. A circle is indicated on the frame in the layout editor.
    FREQUENCY ERRORS
    You may receive frequency errors when a repeating frame is moved
    or deleted,
    thus changing the layering of the frames. Often, users may
    attempt to correct
    this error by adding the deleted frame back, but this does not
    fix the
    problem. The existence of the frame is not enough, even it is
    does not
    overlap other objects in the layout. The frame must also be in
    the right
    position within the hierarchy. In addition to recreating the
    deleted frame,
    you must push the new frame to the right layer using the ARRANGE
    option on the
    Layout menu.
    If you move an object outside its native frame, then you must
    enclose it
    within a repeating frame to group it within the same loop.
    Oracle Worldwide Customer
    Support
    null

  • Is it possible to create reports in 1 month without any experience?

    I'm on a project where we need to make some custom reports in the span of about a month. I'm trying to figure out what is feasible for a person, with no reporting background but plenty of SQL experience,to handle in that time frame.
    The format of all of the reports would be basically the same. We want a histogram next to a window where we can enter in some information, and the histogram would change dynamically. In another frame, we would have access to detailed data (ability to view the actual records).
    Thanks,
    Samir Patodia

    Hi Samir,
    You can look at the Building Reports manual for basic information on how to build reports:
    http://otn.oracle.com/documentation/reports.html
    For your particular case, output to portal may be appropriate. You may want to look at the Reports : Portal integration viewlets:
    http://otn.oracle.com/products/reports/htdocs/getstart/demonstrations/index.html
    At the same time, since you want end-user reporting and dynamic charts, you may want to look at the functionality offered by another Oracle product - Discoverer
    http://otn.oracle.com/products/discoverer/index.html
    Navneet.

  • Need to resize window to show all components !!

    I created a simple java application but there is a wiered problem. Unless i resize or maximise the window, I am unable to see any component I added into it. What is the problem with my code.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    public class CdApp implements ActionListener
         //Frame and Panel:-     
         JFrame cdFrame;
         JPanel cdPanel;
         static PreparedStatement val;
         static ResultSet result;
         int flag;
         //Buttons:-
         // Labels :-
         // Text Fields & Areas:-
         // Strings :-
         // Misc Components:-
         // The MainMethod :-
         public static void main(String[] args)
              CdApp cd_object1 = new CdApp();
              cd_object1.main_page();          
         // Methods:-
         // Main Page:-
         void main_page()
              cdPanel = new JPanel();
              cdFrame = new JFrame("CD Catalog Manager ===> Sukrit Mehra!!");
              cdFrame.setSize(800,600);
              cdFrame.setVisible(true);
              cdFrame.getContentPane().add(cdPanel);
              cdFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        

    can you cut and paste verbetim the following code into a CdApp.java file and compile it and run it and see if you can see a window 800x600 that displays "Hello I'm a JTextArea!" in the top middle to see if it displays without resizing?
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    public class CdApp implements ActionListener{
         JFrame cdFrame;
         JPanel cdPanel;
            JTextArea jta;
            public static void main(String[] args){
                CdApp cd_object1 = new CdApp();
                cd_object1.main_page();
         void main_page(){
                cdPanel = new JPanel();
                cdPanel.add(new JTextArea("Hi I'm a JTextArea!"));
                cdFrame = new JFrame("CD Catalog Manager ===> Sukrit Mehra!!");
                cdFrame.setSize(800,600);                       
                cdFrame.getContentPane().add(cdPanel);
                cdFrame.setVisible(true);                       
                cdFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            public void actionPerformed(ActionEvent ae){       
    }

  • Reports - Data source for repeating frames

    Does anybody know if there is an alternative way to pass data to repeating frames than queries or ref cursors?
    For example can I use a PL/SQL table as source for a repeating frame?

    YES!!!, change the PRINT condition of your
    panel field to ALL instead of FIRST.
    null

  • I want to know when we issue truncate table statement in oracle .

    i want to know when we issue truncate table statement in oracle .No log will be write in redo log .But we can recover data using flashback or scn.I want to know where is the actually truncate table statement log is stored in oracle database.Please explain me in detail step by step .

    Hi,
    I have truncated table after that i have restored that data.See below the example.I want to know from where it's restored.
    From which log file it's restored.
    create table mytab (n number, x varchar2(90), d date);
    alter table mytab enable row movement;
    Table altered.
    SQL> insert into mytab values (1,'Monsters of Folk',sysdate);
    1 row created.
    SQL> insert into mytab values (2,'The Frames',sysdate-1/24);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select CURRENT_SCN from v$database;
    CURRENT_SCN
    972383
    SQL> select * from mytab;
    N
    X
    D
    1
    Monsters of Folk
    30-DEC-12
    2
    The Frames
    30-DEC-12
    N
    X
    D
    SQL> set lines 10000
    SQL> /
    N X D
    1 Monsters of Folk 30-DEC-12
    2 The Frames 30-DEC-12
    SQL> select to_char(sysdate,'yyyymmdd hh24:mi:ss') from dual;
    TO_CHAR(SYSDATE,'
    20121230 09:29:24
    SQL> set timing on
    SQL> truncate table mytab;
    Table truncated.
    Elapsed: 00:00:15.75
    SQL> select * from mytab as of timestamp TO_TIMESTAMP('20121230 09:29:24','yyyymmdd hh24:mi:ss');
    N X D
    1 Monsters of Folk 30-DEC-12
    2 The Frames 30-DEC-12
    Elapsed: 00:00:00.28
    SQL> insert into mytab select * from mytab as of timestamp TO_TIMESTAMP('20121230 09:29:24','yyyymmdd hh24:mi:ss');
    2 rows created.
    Elapsed: 00:00:00.01
    SQL>

  • Oracle Web App Server performance problems

    I am evaluating Oracle Web Application Server 3.0 and while
    everything seems to work ok, the performance is noticeably
    slower than Oracle Web Server 1.0 or 2.0. I have narrowed the
    problem down to the access/execution time to a database
    package. In other words, the PL/SQL code I have built does not
    contain any Oracle SQL statements. The package simply builds a
    small web page. If I had to guess, I would say it appears to be
    related to either a log-in to Oracle (which does not take that
    long in a ProC program) or excessive child process creation
    overhead (other programs like Apache handle this just fine). I
    created the package in the www_user account, set a virtual path
    of /test/owa/ to access it and while the page displays
    correctly, it takes about 12 to 13 seconds to do so.
    I'm running Linux on a Dell 400 MHz Pentium II with 1 Gb of
    ram. I have tried changing the cartridge configuration so that
    it starts with 2 processes instead of the default 0. This
    helped some after the first execution of the package (response
    time went from 12 seconds down to about 7). I am running it
    without security on the virtual path (I thought maybe that was
    slowing things down). I tried setting the user sessions to true
    (default was false) and setting a timeout of 1200. None of
    these things helped (nor did they make it any worse).
    On an old HP system (much slower SQLPlus response time than this
    Dell system), web pages fly at a pretty good speed using PL/SQL
    and version 2 of the web server. Except for the actual database
    query time to perform SQL queries, pages display in subsecond
    time frames; not 12 seconds.
    Please give me some idea how to improve the performance.
    Obviously, something is different with 3.0 than the older wrb
    and server.
    Thanks,
    Bob
    [email protected]
    null

    I am evaluating Oracle Web Application Server 3.0 and while
    everything seems to work ok, the performance is noticeably
    slower than Oracle Web Server 1.0 or 2.0. I have narrowed the
    problem down to the access/execution time to a database
    package. In other words, the PL/SQL code I have built does not
    contain any Oracle SQL statements. The package simply builds a
    small web page. If I had to guess, I would say it appears to be
    related to either a log-in to Oracle (which does not take that
    long in a ProC program) or excessive child process creation
    overhead (other programs like Apache handle this just fine). I
    created the package in the www_user account, set a virtual path
    of /test/owa/ to access it and while the page displays
    correctly, it takes about 12 to 13 seconds to do so.
    I'm running Linux on a Dell 400 MHz Pentium II with 1 Gb of
    ram. I have tried changing the cartridge configuration so that
    it starts with 2 processes instead of the default 0. This
    helped some after the first execution of the package (response
    time went from 12 seconds down to about 7). I am running it
    without security on the virtual path (I thought maybe that was
    slowing things down). I tried setting the user sessions to true
    (default was false) and setting a timeout of 1200. None of
    these things helped (nor did they make it any worse).
    On an old HP system (much slower SQLPlus response time than this
    Dell system), web pages fly at a pretty good speed using PL/SQL
    and version 2 of the web server. Except for the actual database
    query time to perform SQL queries, pages display in subsecond
    time frames; not 12 seconds.
    Please give me some idea how to improve the performance.
    Obviously, something is different with 3.0 than the older wrb
    and server.
    Thanks,
    Bob
    [email protected]
    null

  • My data are not gettitng enterted in the data base

    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    public class Main implements ActionListener
    Frame mainf;
    MenuBar mb;
    MenuItem List,admitform,inquiry,exit;
    Menu newm,update;
    Inquiry iq;
    Admit ad;
    Register reg;
    Main()
    mainf=new Frame(" Engg College V/S Mumbai University ");
         mb=new MenuBar();
         newm=new Menu(" New ");
         update=new Menu(" Update ");
         List=new MenuItem("List");
         admitform=new MenuItem("Admit");
         inquiry=new MenuItem("Inquiry");
         exit=new MenuItem("Exit");
    newm.add(List);
                   newm.add(admitform);
    newm.add(inquiry);
                   newm.add(exit);
              mb.add(newm);
              mb.add(update);
    mainf.setMenuBar(mb);
                   exit.addActionListener(this);
                   List.addActionListener(this);
         inquiry.addActionListener(this);
         admitform.addActionListener(this);
    mainf.setSize(400,300);
         mainf.setVisible(true);
    public void actionPerformed(ActionEvent ae)
    if (ae.getSource() == List)
              reg=new Register();
         if(ae.getSource()==inquiry)
         iq=new Inquiry();
    if(ae.getSource()==admitform)
         ad=new Admit();
              if(ae.getSource()==exit)
         mainf.setVisible(false);
    public static void main(String args[])
              new Main();
    }

    >My data are not gettitng enterted in the data
    base
    no real surprise to me.Can u please help me ??How? There's no connection and prepared staments anywhere in your code. Do you think the database will update itself automagically?

  • Connecting java to Excel

    HI
    Can anyone help me about the code.
    I got the Exception:
    Error while inserting to excel sheet!!!
    java.sql.SQLException:[Microsoft][ODBC Excel Driver]Operation must use an updateable query.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    public class InsertExcel
    static JFrame frame;
    static JPanel panel;
    static JTextField textuserid;
    static JTextField textfirstname;
    static JTextField textlastname;
    static JButton submit;
    static JButton exit;
    public static void main(String args[])
    frame = new JFrame("Inserting to excel sheet");;
    panel = new JPanel();
    JLabel labeluserid = new JLabel("User id ");
    JLabel labelfirstname = new JLabel("First Name");
    JLabel labellastname = new JLabel("Last Name");
    textuserid = new JTextField(20);
    textfirstname = new JTextField(20);
    textlastname = new JTextField(20);
    submit = new JButton("Submit to Excel sheet");
    exit = new JButton("Exit");
    panel.add(labeluserid);
    panel.add(textuserid);
    panel.add(labelfirstname);
    panel.add(textfirstname);
    panel.add(labellastname);
    panel.add(textlastname);
    panel.add(submit);
    panel.add(exit);
    frame.getContentPane().add(panel);
    frame.setSize(1024,100);
    frame.setVisible(true);
    frame.setDefaultCloseOperation(3);
    submit.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent e)
         try
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              Connection con = DriverManager.getConnection("jdbc:odbc:population");
              PreparedStatement stat2 = con.prepareStatement("insert into [Sheet1$ (USERID,FIRST_NAME,LAST_NAME) values (?,?,?)");
              stat2.setString(1,textuserid.getText());
              stat2.setString(2,textfirstname.getText());
              stat2.setString(3,textlastname.getText());
              stat2.executeUpdate();
              JOptionPane.showMessageDialog(frame,new String("Successfully entered to excel sheet !!!"));
         catch(Exception e1)
              JOptionPane.showMessageDialog(frame,new String("Error while inserting to excel sheet !!! \n" +
    e1));
    exit.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent ex)
         System.exit(0);
    Message was edited by:
    lesbon

    This works fine for me. Adapt it.
    import java.sql.*;
    public class ExcelInsert
       public static final String DEFAULT_DRIVER = "sun.jdbc.odbc.JdbcOdbcDriver";
       public static final String DEFAULT_URL = "jdbc:odbc:DRIVER={Microsoft Excel Driver (*.xls)};DriverID=22;READONLY=false;DBQ=";
       public static final String DEFAULT_PATH = "C:\\Documents and Settings\\Michael\\My Documents\\Projects\\Java\\Forum\\data\\ExcelInsert.xls";
       private static final String DEFAULT_SQL = "INSERT INTO [SHEET1$] VALUES(?, ?, ?)";
       private Connection conn;
       public static void main(String[] args)
          Connection c = null;
          try
             c = createConnection(DEFAULT_DRIVER, DEFAULT_URL+DEFAULT_PATH);
             ExcelInsert inserter = new ExcelInsert(c);
             String v1 = ((args.length > 0) ? args[0] : "foo");
             String v2 = ((args.length > 1) ? args[1] : "bar");
             String v3 = ((args.length > 2) ? args[2] : "baz");
             int numRows = inserter.insert(v1, v2, v3);
             System.out.println("# rows inserted: " + numRows);
          catch (Exception e)
             e.printStackTrace(System.err);
          finally
             close(c);
       public static Connection createConnection(String driver, String url) throws SQLException, ClassNotFoundException
          Class.forName(driver);
          return DriverManager.getConnection(url);
       public ExcelInsert(Connection conn)
          this.conn = conn;
       public static void rollback(Connection c)
          try
             if (c != null)
                c.rollback();
          catch (SQLException e)
             e.printStackTrace();
       public static void close(Connection c)
          try
             if (c != null)
                c.close();
          catch (SQLException e)
             e.printStackTrace();
       public static void close(Statement s)
          try
             if (s != null)
                s.close();
          catch (SQLException e)
             e.printStackTrace();
       public int insert(String a1, String a2, String a3) throws SQLException
          int numRows = 0;
          PreparedStatement stmt = null;
          try
             stmt = this.conn.prepareStatement(DEFAULT_SQL);
             stmt.setString(1, a1);
             stmt.setString(2, a2);
             stmt.setString(3, a3);
             numRows = stmt.executeUpdate();
          catch (SQLException e)
             e.printStackTrace();
          finally
             close(stmt);
          return numRows;
    }%

Maybe you are looking for

  • Difference between idoc and rfc

    what is the difference between idoc and rfc? when and where it is used? when there is idoc, why rfc vice versa?

  • System extension cannot be used - on startup?

    Recently, I had to repair permissions after a error cause me not to be able to login. I did a startup from the disc and got in, but now these error messages come up; System extension cannot be used "/System/Library/Extensions/SymIPS.kext" was install

  • Appending a character to a string

    Hi I am trying to read in a sequence of numbers from a file, theyre of the form: 0.034 0.113 0.987 etc. What i am trying to do is read in the line of these numbers, and if we are not at a space in the numbers or at the end of file I want to append th

  • On Nano number 8

    I have had 8 5th gen Nano's since April. Each time a new one arrives under the warranty I use it once and then it dies. Nothing I do will will revive it and I have tried resetting, draining the battery etc. It syncs fine with Itunes and all software

  • HP management pack - network ports

    Hi all, sorry for my englisch . I have server with 4 network ports , but only 2 is connected . The scom alert me to 2 port is not connected. Can I overrite this behavior and control only 2 connected ports ? thanx Falcon