This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Dynamic Query tool Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Dynamic Query tool" Watch "Dynamic Query tool" New topic

Dynamic Query tool

Manas Ahlaad
Ranch Hand

Joined: Nov 07, 2001
Posts: 165
I have been breaking my head since one week to come up with a novel solution for the following problem:
Lets take a typical database schema. It contains number of tables, of which ,
... some have primary key/foreign key relation ship,
... there can be one or more tables which mediate to form a relation between two tables.
User has a requirement like this:
He should be given UI such that he will have the option to select some from a series of business attributes .These attributes which will map to database columns.
He can select attributes in such a fashion that
... some of the attributes may be columns of two tables which has primary/foreign key relationship
... some of the attributes from disjoint tables which will be linked indirectly through one or more tables
Taking all these into consideration,
if user submits the Search , we have to form a query based on above and give the user resultant records.
We have to avoid resulting cartesian product (It results when there is no join or filter)
How do you look at such kind of system ??
We proposed user to use Crystal Reports. But user doesnt want to get exposed/fall in the risk of understanding the database structure. He just wants a system where in he can select business fields (with out applying his domain knowledge as to whether these fields logically relate or not) and he wants to get results.
Any help/views are appreciated.

Manas<br />Today If You are not Confused,You are just not thinking Clearly !<br />---------------------------------
Rudy Dakota
Ranch Hand

Joined: Jul 27, 2002
Posts: 54
Hi there,
Sounds rather wierd to me. Especially this bit:
he can select business fields (with out applying his domain knowledge as to whether these fields logically relate or not) and he wants to get results

Your customer wants to be able to specify reports without knowing themselves whether these make sense? Next step they 'll be telling you your report is not 'correct'. Also 'with out applying his domain knowledge'? Wouldn't think so.
I 'd say it is either of two ways: or your customer applies his domain knowledge, or you 're free to combine data in sensible or senseless groups as you like.
Good riding,
I agree. Here's the link:
subject: Dynamic Query tool
jQuery in Action, 3rd edition