0

How can i retrieve data from Database using Java Server Page? Can anybody help me to know the concepts, because am a new one to work in Java Server Page.

2

2 Answers 2

2

For beginner to java-ee i would recommend to read the tutorials of Oracle Documentation which are very helpful and provides strong basics .

Apart from it you can find many basic examples in the below sites

And to your question here is the example. As @joop stated it very important to adhere MVC pattern

Hope this helps

Sign up to request clarification or add additional context in comments.

Comments

2

One can use the sql tag.

However often one sees a separation using MVC, Model-View-Controller.

Where a servlet (controller) fills the data (model) in a request attribute, and forwards to a JSP (view), that uses the resulting request attribute.

Then the JSP functons as a template and is more readable.

2 Comments

Direct [SQL] queries in views has to be one of the worst "features" of JSP/ASP :|
@user2864740: thanks for someone else saying that too. One would then use a JSP as one would use a PHP or ASP. For starters okay, as one always can program in a structured way. MVC is cleaner.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.