File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes getting details from database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "getting details from database" Watch "getting details from database" New topic

getting details from database

kirankumar dondapati

Joined: May 25, 2007
Posts: 4
how to get values from database and display them to the user using struts frame work? please write the code
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3381


please write the code

I dont think here anyone will take the assignments

What have you written till now or thought of writing? Let us know that first.

Even if not in Struts, are you aware of retrieving the data from the database and display it? If your answer is NO to this question, please read about JDBC and the way you can interact with database and how you can get the values from the database. As this is the basic for any database related operations in your application.

Then you can think of displaying it in JSP and through Struts.

Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Mathias Nilsson
Ranch Hand

Joined: Aug 21, 2004
Posts: 367
First of all you should not connect to database direct from Struts actions. This should be done in the model layer. The model layer can be built outside the struts framework so the best place to ask this type of question is in the JDBC forum, or check the Hibernate ORM framework.

When I googled "database connection in struts" I got a lot of hits. Haven't read them but please try google for this first

Sorry Posted this at the same time.

// Mathias
[ May 25, 2007: Message edited by: Mathias Nilsson ]

Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3381

Hey Mathias,

This happened with me also once. That too exact replica of the answer

Stay Cool
I agree. Here's the link:
subject: getting details from database
It's not a secret anymore!