What Is J2EE?
What Is J2EE?
com
What is J2EE?
J2EE is just a specification by Java that aims to fulfil software needs of enterprise. There are several APIs and technologies such as JSP, EJB etc which make J2EE a working platform. We will discuss this soon.
What is specification?
Specification is set of rules defined by any company which has to followed by all the vendors. Eg: The specification for three pin socket we see in our home defines the space between pin, lenght of pins and width of pins. All 3 pin socket manufacturer follw the specification. They can use different material or colour and also can price extra features but they have to follow the specifcation. This solves lots of problem. We can use three pin manufacted by any company.
Why J2EE?
J2EE is one of the best choice for developing enterprise applications. Some advantages of using J2EE for enterprise applications are listed below: 1. Low cost 2. Good Support from community 3. Open Source 4. Good documentation 5. Availability of good J2EE developers. 6. Low level services are already implemented: 7. J2EE is a standardized and reliable software architecture 8. It has huge user base and is popular in market. 9. J2EE uses multi-tiered distributed application model.
Visit ExamFear.com for Free Question Papers for almost all Exams.
Page
2. Servlets 3. JSP 4. Java Mail 5. RMI 6. Corba 7. EJB 8. JNDI 9. JMS 10. JAVA-XML 11. Connectors
( Server Side Component) ( Java Server Pages) ( Used to create email application) ( Remote Method Invocation) ( Comon object request broker object) ( Enterprise Java Beans) ( Java Naming & Directory Interfaces) ( Java Messaging Service) ( JAXP, JAXM, JAXR, JAX-RPC, JAXB ) ( For Legacy systems).
JDBC:
JDBC stands for Java Database Connectivity, which is a standard Java API for database-independent connectivity between the Java programming language and a wide range of databases such as MySql, Microsoft SQL, Oracle etc. We can perform the following functions with JDBC : 1. Make a connection to a database 2. Create SQL or MySQL statements 3. Execute SQL or MySQL queries in the database 4. View & Modify the resulting records To understand JDBC , we should now Core Java and SQL database. To use JDBC make sure that core java is installed in your system. Also make sure that SQL database is installed. Steps to create JDBC Application: 1. Import the packages: Use import java.sql.* statement in your java code. Before ading this statement, please make sure that you have jar files for SQL. 2. Register the JDBC driver: we need to initialize JDBC driver to open a communication channel with database. 3. Open a connection: This requires using the DriverManager.getConnection() method to create a Connection object, which represents a physical connection with the database as follows.We need to provide database credentials . 4. Execute a query : Here we need to use executeQuery method. ResultSet rs = stmt.executeQuery(sql); 5.Extract data from result set: This step is required in case you are fetching data from the database. 6. Clean-up environment: This is used to close connection.
Servlets:
Page Servlets are Java classes that run at the server end.To run servlets, your Web server should be servletenabled, i.e. a servlet engine should be installed to interpret and run your servlet code on your web server.Servlets are Java technology's answer to CGI programming. Servlets are server side components that
Visit ExamFear.com for Free Question Papers for almost all Exams.
provide a powerful mechanism for developing server side programs. Servlets provide component-based, platform-independent methods for building Web-based applications. Servlets are not designed for a specific protocols. It is different thing that they are most commonly used with the HTTP protocols Servlets uses the classes in the java packages javax.servlet and javax.servlet.http. To create Servelet we need to create a Class that implents httpservlet. Once that is done we can override doget and dopost method. Advantages of servlet: Efficient: Each request in servlet is handled by light weigh thread. Convenient. If you already know java, learning servlet is very simple. Powerful. Java servlets is a powerful tool,Servlet can talk directly to web server. Also session handling can be done easiliy in Servlet. Portable. Servlets are written in Java and follow a well-standardized API. So you can run the code in any machine which has JVM installed. Inexpensive. There are a number of free or very inexpensive Web servers available that are good for "personal" use or low-volume Web sites. Open Source: Since Servlet is opensource, you need not pay to use it.
What is JSP?
Java Server Pages (JSP) is a technology that lets you mix regular, static HTML with dynamically-generated HTML. JSP is the extension of HttpServlet instance. JSP is basically used for presentation and servlet is used for bussiness logic although you use servlet for presentation after all JSP page also boil down to jsp servlet. We need JSP when we want to read or write values to session object.The one major advantage of Jsp is we can java code directly embeded into html code.
Advantages of JSP: 1. Dynamic : You can builkd dynamic websites with JSP 2. Open Source : Since JSP is open source, we need not pay to anyone to use it. 3.Secure: JSP pages are secure. 4. Easy to learn: The business logic for JSP is servelet which is written Java. So if you know Java, learning JSP applicatioj is simple.
Java Mail:
Java Mail service is used to add mailing functionalities to java application. Since it use java as platform, so we get all features of java such as platform independent, open source, good community support etc. We can write functionalility to read, compose, search and send mail using Java Mail service. The Java Mail API 1.4.1 supports JDK 1.4 or higher version. Steps to install Java Mail Service in your local machine 1. go to http://java.sun.com/products/javamail/downloads/index.html 2. Download javamail-1_4_1.zip 3. Unzip it 4. Set class path to the jar we get by unzipping the zip
Visit ExamFear.com for Free Question Papers for almost all Exams.
Page
CORBA:
The Common Object Request Broker Architecture (CORBA) is a standard defined by the Object Management Group (OMG) that enables software components written in multiplecomputer languages and running on multiple computers to work together (i.e., it supports multiple platforms).
In Simple java coding that is POJO (Plain old java object), developer has to write code to manage sessions, events etc. EJB provide heavy weight container to manange session, events etc. EJB has capability for: 1. Session Bean : Synchronous 2. Message Driven Bean: Asynchronous
Visit ExamFear.com for Free Question Papers for almost all Exams.
Page
2. POJO has programtic life cycle management while EJB has declarative life cycle management 3. Services like security, transaction , clustering, caching etc has to be coded from scratch in POJO.. IN case of EJB, these thing are declarative. We need not code for this. 4. POJO Programmatically implements protocols to provide remote services. EJB provides distributed environemnt with pre-defined proticol implementation
Disadvantage of EJB 2.X: 1. Very complex to code. Required home interface, component interface, implementation class, callback methods, deployment descriptor. 2. EJB requires application server. 3. Heavy weight container and has performance issues.
SPRING killed EJB 2.X market.So SUN came with EJB 3.0 Disadvantage of spring: it is not part of JSR standard, and thus no support from community. Advantage of EJB is that it is part of JSR standard and thus there is good support from community. EJB 3.0 = POJO +Light weight container. EJB 3.0 can run on: 1. JBOSS : it use micro container 2. Weblogic : It uses SPRING container
JNDI:
The Java Naming and Directory Interface (JNDI) is a Java API for a directory service that allows Java software clients to discover and look up data and objects via a name. Like all Java APIs that interface with host systems, JNDI is independent of the underlying implementation. Additionally, it specifies a service provider interface (SPI) that allows directory service implementations to be plugged into the framework. It may make use of a server, a flat file, or a database; the choice is up to the vendor.The JNDI API is used by the Java RMI and Java EE APIs to look up objects in a network. The JNDI API provides: 1. A mechanism to bind an object to a name 2. A directory lookup interface that allows general queries 3. An event interface that allows clients to determine when directory entries have been modified
JMS:
Page
Visit ExamFear.com for Free Question Papers for almost all Exams.
What Is Messaging?
Messaging is a method of communication between software components or applications. A messaging system is a peer-to-peer facility: A messaging client can send messages to, and receive messages from, any other client. Each client connects to a messaging agent that provides facilities for creating, sending, receiving, and reading messages. Messaging enables distributed communication that is loosely coupled. A component sends a message to a destination, and the recipient can retrieve the message from the destination. However, the sender and the receiver do not have to be available at the same time in order to communicate. In fact, the sender does not need to know anything about the receiver; nor does the receiver need to know anything about the sender. The sender and the receiver need to know only what message format and what destination to use. In this respect, messaging differs from tightly coupled technologies, such as Remote Method Invocation (RMI), which require an application to know a remote application's methods. Messaging also differs from electronic mail (e-mail), which is a method of communication between people or between software applications and people. Messaging is used for communication between software applications or software components. What Is the JMS API? The Java Message Service is a Java API that allows applications to create, send, receive, and read messages. Designed by Sun and several partner companies, the JMS API defines a common set of interfaces and associated semantics that allow programs written in the Java programming language to communicate with other messaging implementations. The JMS API minimizes the set of concepts a programmer must learn to use messaging products but provides enough features to support sophisticated messaging applications. It also strives to maximize the portability of JMS applications across JMS providers in the same messaging domain. The JMS API enables communication that is not only loosely coupled but also Asynchronous. A JMS provider can deliver messages to a client as they arrive; a client does not have to request messages in order to receive them. Reliable. The JMS API can ensure that a message is delivered once and only once. Lower levels of reliability are available for applications that can afford to miss messages or to receive duplicate messages.
Java XML:
XML stands for Extensible Markup Language and was defined 1998 by the World Wide Web Consortium (W3C). A XML document consists out of elements, each element has a start tag, content and an end tag. A XML document must have exactly one root element, e.g. one tag which encloses the remaining tags. XML makes a difference between capital and non-capital letters. A XML file is required to be well-formated.Java contains several methods to access XML. Java provides the DOM API (Document Object Model). In DOM your access the XML document over an object tree. DOM can be used to read and write XML files. SAX (Simple API for XML) is an Java API to sequential reading of XML files. SAX can only read XML documents. SAX provides an Event-Driven XML Processing following the Push-Parsing Model. What this model means is that in SAX, Applications will register Listeners in the form of Handlers to the Parser and will get notified through Call-back methods. Here the SAX Parser takes the control over Application thread by Pushing Events to the Application. Both DOM and Sax are older API's and I recommend not to use them anymore.
Visit ExamFear.com for Free Question Papers for almost all Exams.
Page
Stax (Streaming API for XML) is an API for reading and writing XML Documents. Introduced in Java 6.0 and considered as superior to SAX and DOM. Java Architecture for XML Binding ( JAXB ) is a Java standard that defines how Java objects are converted to/from XML (specified using a standard set of mappings. JAXB defines a programmer API for reading and writing Java objects to / from XML documents and a service provider which / from from XML documents allows the selection of the JAXB implementation JAXB applies a lot of defaults thus making reading and writing of XML via Java very easy. Java Architecture for XML Binding (JAXB) is a Java standard that defines how Java objects are converted to/from XML (specified using a standard set of mappings. JAXB defines a programmer API for reading and writing Java objects to / from XML documents and a service provider which / from from XML documents allows the selection of the JAXB implementation JAXB applies a lot of defaults thus making reading and writing of XML via Java very easy.
Connectors:
The J2EE Connector architecture provides a Java technology solution to the problem of connectivity between the many application servers and today's enterprise information systems. While JDBC is specifically used to connect Java EE applications to databases, JCA is a more generic architecture for connection to legacy systems (including databases). As more businesses move towards an e-business strategy, integration with existing enterprise information systems (EIS) becomes the key to success. Enterprises with successful e-businesses need to integrate their existing EIS systems with new web-based applications. They also need to extend the reach of their EIS systems to support business-to-business (B2B) transactions. Before the the J2EE Connector architecture was defined, no specification for the Java platform addressed the problem of providing a standard architecture for integrating heterogeneous EIS systems. Most EIS vendors and application server vendors use non-standard vendor-specific architectures to provide connectivity between application servers and enterprise information systems
Visit ExamFear.com for Free Question Papers for almost all Exams.
Page