Showing posts with label servlet. Show all posts
Showing posts with label servlet. Show all posts

Monday, May 16, 2011

Architecture of the Servlet Package


The javax.servlet package provides a set of interfaces and classes for writing servlets.


These classes and interfaces are normally found in 'Enterprise Edition' versions of the Java SDK. They are also included within TJI's ide.jar so that servlets can be developed by those without an EE SDK.
The architecture of the servlet package is described below.

Saturday, May 14, 2011

How to retrieve data from database, using servlet or a jsp?

Basics of Database Connectivity 
In java we have been provided with some classes and APIs with which we can make use of the database as we like. Database plays as very important role in the programming because we have to store the values somewhere in the back- end. So, we should know how we can manipulate the data in the database with the help of java,  instead of going to database for a manipulation. We have many database provided like Oracle, MySQL etc. We are using MySQL for developing this application. 
In this section, you will learn how to connect the MySQL database with the Java file. Firstly, we need to establish a connection between MySQL and Java files with the help of MySQL driver .  Now we will make our  account in MySQL database so that we can get connected to the database. After establishing a connection  we can access or retrieve data form MySQL database. We are going to make a program on connecting to a MySQL database, after going through this program you will be able to establish a connection on your own PC