Huge DB query ideas needed

Discussion in 'Java' started by iksrazal, Mar 9, 2005.

  1. iksrazal

    iksrazal Guest

    Hi all,

    I'm recieving a Bean from a web page that has something like 50
    parameters, only one is mandatory. The idea is to use all these
    parameters for a big select, filtering out data and returning what is
    seached for. Any idea for something better than lots of 'if'
    statements? For example...

    private void createSelect(StringBuffer query, TrackerFilter param)
    {
    query.append("select distinct act from Activity act ");
    if (param.getClientName() != null)
    {
    query.append("join act.clientInfo client");
    }
    // much more of the same
    }

    private void setParameters(Query
    query, TrackerFilter param)
    {
    if (param.getClientName() != null)
    {
    query.setParameter("clientName", param.getClientName() + "%");
    }
    // much more of the same
    }

    Any ideas?
    iksrazal
    iksrazal, Mar 9, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hardy Wang

    Suggestion needed for huge DataGrid

    Hardy Wang, Nov 12, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    336
  2. The Eeediot
    Replies:
    3
    Views:
    513
    =?Utf-8?B?QW5kcmV3IENvcmxleSwgTUNTRCwgTUNEQkE=?=
    Nov 16, 2004
  3. Beda Christoph Hammerschmidt

    Huge XML data needed

    Beda Christoph Hammerschmidt, Apr 1, 2004, in forum: XML
    Replies:
    15
    Views:
    2,987
    Torsten Bittner
    Apr 21, 2004
  4. Replies:
    3
    Views:
    481
  5. Ryan Macy

    Ideas needed & help needed!

    Ryan Macy, Jul 19, 2006, in forum: Ruby
    Replies:
    2
    Views:
    493
    Ryan Macy
    Jul 19, 2006
Loading...

Share This Page