Slide 1: WEB COMPONENT DEVELOPER
ADVANCE JAVA Presenting - at SEED Infotech Ltd. 'panchsheel' 42/16, Erandawana, Seed Infotech Lane, Off Karve Road Pune by – Hansraj Sidh
C.S 7th Sem.
marudhar engg. college firstname.lastname@example.org Components to Study : Components to Study Java Database Connectivity
Java Server Pages
XML JDBC – Java DataBase Connectivity : JDBC – Java DataBase Connectivity JDBC is a Java API that enables java program to execute SQL Statements.
The JDBC API can also be used to interact with multiple data sources in a distributed , heterogeneous environment. JDBC : JDBC Java
API Driver Driver Driver Oracle
DB SQL server
DB Driver Driver Driver Driver Driver JDBC (Drivers) : JDBC (Drivers) JDBC-ODBC Bridge (Type 1)
Native-API partly Java Driver (Type 2)
Net-Protocol All-Java Driver (Type 3)
Native Protocol All-Java Driver (Type 4)
List of JDBC Drivers-
http://industry.java.sun.com/products/jdbc/drivers JDBC – ODBC Bridge (Type 1) : JDBC – ODBC Bridge (Type 1) Java
ODBC Drivers JDBC
API Database Function –
Translate JDBC call to ODBC calls and send them to the ODBC database.
It is a java Wrapper developed over ODBC API.
Advantages - 1. Easily available as part of JDK
2. Easy to install.
Disadvantages- 1. slower in performance.
2. Limited to functionality of ODBC driver.
3. Not Recommended for production environment. Native-API partly Java Driver(Type2) : Native-API partly Java Driver(Type2) Java
Application JDBC Driver JDBC
API Database Vendor API Written partly in java & partly in native code.
It uses a mixture of Java implementation and vendor-specific native API’s to
Uses native ‘c’ language lib calls for conversion.
Advantage – these offer better performance than jdbc-odbc bridge as layers are
less and it uses Native API which is database specific.
Disadvantage – not fully in java so portability issue , if database is changed than
native API must be changed as it is database specific. provide data access. Network Protocol All-Java Driver(type3) : Network Protocol All-Java Driver(type3) Java
Client JDBC Driver JDBC
API Database Native Driver JDBC Driver
Server This driver is Server based. So, the Vendor DB lib. Is not required for clients.
Uses DB independent Protocol to communicate DB-requests to a Server component.
Translates requests into DB-specific Protocol.
Advantages- 1. fully written in java , hence portable.
2. The net protocol can be designed to make the client JDBC driver very small and
fast to load.
3. most efficient amongst all drivers.
Disadvantages- 1. requires another server application to be installed and maintained.
2. clients connect to DB servers via an intermediate server component that acts as a gateway for multiple database servers. Slide 9: Native Protocol All-Java Driver(type4) Java
Client JDBC Driver JDBC
API Database Vendor-Specific Protocol JDBC calls are directly converted to network protocol used by DBMS server
It makes direct socket connections to the databases.
Advantages – 1.written in java only. So we can achieve platform independency.
2.number of translation layers are very less.
3.performance is good.
The user need a different driver for each database JDBC : There are seven standard steps in querying databases:
1. Load the JDBC driver.
2. Define the connection URL.
3. Establish the connection.
4. Create a statement object.
5. Execute a query or update.
6. Process the results.
7. Close the connection. JDBC Servlet : Servlet Java Servlets are web components which allow app. Logic to be embedded in HTTP request-response process and provide a way by which we can build a web application.
It is a web server technology which is –
Secured Class hierarchy for Servlet : HttpServlet GenericSevlet ServletConfig Servlet Serializable Class hierarchy for Servlet Servlet Life Cycle : Servlet Life Cycle Servlet Client Interaction Service () Init () Destroy () Servlet is loaded and initialized
It handles the client requests
It is unloaded ServletConfig : ServletConfig By making use of ServletConfig object servlet can get the configuration environment in which it is working.
The servlet API provides various means of accessing the SevletConfig object associated with the servlet.
ServletConfig provides access to certain initialization parameters that can be configured while deploying the servlet. Java Server Pages : Java Server Pages Java code embedded in HTML code
More HTML code than Java code
Manage the dynamic presentation by simplifying the dynamic presentation layer in a multi-tiered architecture
Separate presentation and business logic
Template based content generation-JSP JSP – predefined tags : JSP – predefined tags ->3 types of predefined tags
->Custom tags JSP directives : JSP directives The general syntax for a directive is:
<%@ directive [….]%> Scripting Elements : Scripting Elements What is XML ? : What is XML ? XML stands for Extensible Markup Language.
XML is a markup language much like html.
XML was designed to describe data.
XML tags are not predefined in XML. You must define your own tags.
XML is self describing.
Building blocks of XML document :
CDATA THANKYOU !! : THANKYOU !! Any Query?