Venkat,
Welcome to JavaRanch!
I assume you are using
Struts since this is in the Struts forum.
The traditional way is to have Struts call a session bean which calls one of the following:
1) Data access object with
JDBC code
2) Data access object with entity bean or JQL code
3) Data access object with a third party Object Relational library
For examples, just search for a tutorial on the technology you decide to use.