This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.
The java program is a collection of cooperating objects. Object oriented programming and design depends on four principle concepts. Abstraction, Polymorphism, Inheritance and Encapsulation are said to be as four principle concepts. Abstraction is nothing but including all necessary features but there should not be any background information and explanation. Polymorphism is the ability of the method or class to assign different meaning or usage with the object that is performing upon. This can be explained simply by having one interface and many implementations. Inheritance is said to be objects of one class retrieves the properties of objects of some other class. A class which is inherited is called base class or super class. The class which performs the inheriting is called sub class. Extends is keyword which is used for inheritance. Encapsulation is a method used for hiding or protecting the behavior and properties of an object. That can be done in two ways by declaring class as private or public. If it s referred as private none can access properties of the class from outside the class. It is also called data hiding. So by using this technique it protects from other objects to alter or access the properties of this class.
A package is the one of feature in java. There are two types of packages. These are System defined package and User defined package. In java there are more APIs available. Abstract Window Toolkit, Java Collections Framework, Swing, Java Cryptography Extension, Accessibility, Image I/O, Sound, Remote Method Invocation, Java Database Connectivity, Java Authorization Service, Java Secure Socket Extension, Java Native Interface, Java Management Extensions, Java Communications, Java Data Objects, Java Media Framework, Java Authentication, Java Naming and Directory Interface, Java Speech , Java 3D, Java OpenGL, Java Mail, Java USB these are bundled API in Java 2 Standard Edition (J2SD). Java Message Service, Java Server Faces and Java API for XML - Based RPC these bundled in Java 2 Enterprise Edition. In Java 2 Mobile Edition also have a some APIs. These are Connected Limited Device Configuration and Java Telephony API.
JAVA APPLETS are programs that are meant to execute the program on the web browser. In java standalone applications compile and execute the program on the same system. Applets program is compile on the server side and execute on the client system. In the server send the compile version of program in the format of HTML. The HTML file is executed on the client system. The applet class provides capabilities for loading Images, Sounds and Animations. Applet has a Life Cycle. It starts from init() it is used to first loaded into the browser. Start() is used to start animation. Paint(Graphics g) is draw a in the web browser. Stop() is used to stop the animation and the end of section destroy() is kill the process in the browser. Applet has special features. They are getcodebase, getParameter, getWidth, getHeight, getGraphics, showDocument, showStatus, getCursosr, setCursor, getAudioClip, getBackground, getForeground and each of these method do the special thing in the browser. Events are the main in the graphical programming interface. Events are embedded to applet program. There is more event action available in java. There are two types of events. These are mouse event and keyboard. If you click in workspace by mouse or press any key in keyboard the response action will be displayed. In applet we don't use any database that is we can't store the data's.
Java servlets represent a new approach to dynamic HTML generation. A servlets is basically java programming language class that is used to improve or widen the ability of servers that can able to host applications. Servlets has the capacity to reply or respond different types of request it gets that are basically implemented for web servers to host applications.
Servlets has ability to create web pages dynamically that holds live data. Form data is processed by servlets which is entered in web browser page and its very helpful in processing this form. Servlet is the server side programming which executes on the server that can capable of managing numerous requests from client side and responds to all of them. Servlet is a server side program which runs on the server, handles multiple requests from client and revert response to them. Servlet is two types. There are GenericServlet and HTTPServlet. Generic Servlet is an abstract class and HTTP servlet is a concrete class. In each have a several methods for get the request from the client and give the response to client. Servlets will execute only within the server which obviously improves the feature of the server. Servlets are run always inside the server and it improves the functionality of a server. Each servlet has the life cycle to execute the program. A server loads and initializes the servlet by using init () method. The servlet handles a requests and response by using service (). At the end of the servlet the server removes the servlet by using destroy () method.
Presentation logic can be alienated from business logic in JSP but this process cannot be proceeding with servlets. JSP is nothing but Java server pages and it is primarily used as server side programming language. JSP is used as presentation layer. Java program can be embedded with HTML page with some special tags and that is said to be the main advantage of JSP. .
Servlet is done with the same concept but it is easy to build up JSP comparing to servlet. In jsp connectivity is made with database is to not only store the information to the database. We download the entire file and upload the file. Java Bean also use in the jsp. The most important part in the internet is cookies. The server system writes a file in the client system. It's just like the attendance. The file contains information about what the client system required and how much they require the action. In JSP we use implicit objects like Request, Response, Page Context, Session, Application, Out, Config, Page and Exception. Each object does the certain job. In jsp have special tags. There are so many action tags available in jsp. The most commonly used action tags are three. Include, forward and use bean.
JDBC - Java Database Connectivity. In java we make stand alone application or web application at the time we want to store the user data or any other data we achieve the storing information in database by using JDBC connectivity. JDBC is a INTERFACE between java application and database such as Access, Oracle, Sybase, etc…Only a single package is required java.sql or javax.sql
JDBC require components these are
Driver Manager - it purpose is Loads database drivers and manages the connection between the application and the driver
Driver - it is used to translate the codes from java API into specific data source.
Connection - A session between an application and a database
Statement - An SQL statement to perform a query from java API
Metadata - SQL query is executed we get result information about the database and the driver
Result Set - Return the record from the database.
We achieve the connectivity by using JDBC Drivers. There are four type of driver available. These are JDBC-ODBC Bridge, Native -API, JDBC-net and Native protocol. Two major components of JDBC are Connection Pooling and Data Sources, if any errors occurred in the connectivity by handling errors using exception java.sql.exception that is mainly occurred by connection errors in database, sql statement errors and inadequate database privileges will create errors in SQL exception object.