File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes How Do I make the same application look at Different Queries in different Modes? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How Do I make the same application look at Different Queries in different Modes?" Watch "How Do I make the same application look at Different Queries in different Modes?" New topic
Author

How Do I make the same application look at Different Queries in different Modes?

Sege Stephen
Ranch Hand

Joined: Oct 06, 2007
Posts: 51
Hi, I have an Application . Basically, what I need to do is to make the application Use different queries to access data from the database.

Eg, Application in A mode uses a DAO to get the name and address of the users.

Application in B mode uses the same DAO to get the name and address, also telephone detail, email address of the Users. There are two queries in the DAO, when app is in Mode a, it looks at DAO and execute the first query, when in mode B, it looks at the same DAO and execute the second query.


Right, I thought about doing this by having two links on the home page, when you Select App Mode A link, it always execute Query one, when you Select link two which is APP in B mode, it executes Query Two.

HOw do I pass Parameters so that App knows it is in A mode, or B mode. Or better still, what is the best way of doing this, please tell me. I just want Ideas and I would really appreciate it.

Thanks
Sege
Arthur Buliva
Ranch Hand

Joined: Mar 08, 2006
Posts: 101
What about overloading methods?

something like, for instance,

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How Do I make the same application look at Different Queries in different Modes?
 
Similar Threads
Using same object for multiple uses
SQL injection?
execute() and prepared statements
Syntax error
how hibernate works?