• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

regarding structure of code

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, i am a struts2 beginner.. i have code for 'searching' in that user is allowed to search data by a column name.
user enters a data in jsp and calls action and display in another jsp.



and a jsp page

i am using a separate java code for connection with database, in the same way i want to separate the a part of code containing database query. But then how to pass the parameters like tblName, searchparametername1 and searchvalue1 ???

Can anyone suggest me a logic ??
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Poonam Dhatavkar wrote:
But then how to pass the parameters like tblName, searchparametername1 and searchvalue1 ???



Pass them as parameters to the database method. The pattern you are thinking about is called a Data Access Object.
 
reply
    Bookmark Topic Watch Topic
  • New Topic