EJB V3.0 database Persistence in eclipse

Source: Internet
Author: User
Tags db2 ibm db2 requires websphere application server

Learn to create an EJB V3.0 entity Bean using the ECLIPSE-WEBSPHERE7-DB2 database

Introduction: EJB V3.0 provides a robust toolset for implementing data persistence using Java™ technology. Using EJBS is not difficult. Learn how to use these features in your Eclipse environment, and make your applications more tightly integrated with useful data. Although this article takes a trial version of the ibm®websphere® application server and db2® as an example, the technology discussed can be applied to the Community edition of WebSphere Application Server and DB2.

Brief introduction

Data availability has changed in the area of application development. Different data comes from different sources. On the one hand, this makes the application richer than ever; on the other hand, all this data may become difficult to handle. If you need to persist data, not just read it, the situation becomes more complex.

In the Java environment, EJB appears as a reliable persistence method that enables good maintenance and proper role separation. The EJB V3.0 continues to evolve, and more and more tools and methods are emerging. Using EJBS is not difficult. For Eclipse and some basic concepts, you can take advantage of them in your application.

EJB V3.0

EJB V3.0 simplifies the development of EJBS by using annotated APIs, where remote/local interfaces, home/local interfaces, and deployment descriptors are no longer needed, but can continue to be used. Developing Entity EJB requires a Java IDE, an application server, and a relational database. WebSphere v6.x requires the creation of an EJB V3.0 entity Bean using the WebSphere application Server V6.1 Feature Pack. The WebSphere V7 itself has support for EJB V3.0. The Eclipse IDE is one of the most commonly used open source Java Ides. In this article, we will develop an EJB V3.0 entity Bean by using Eclipse, IBM WebSphere7, and IBM DB2 9.5来.

The EJB V3.0 specification for WebSphere uses the Java persistence API (JPA) to implement persistence. JPA is based on other persistence technologies, such as Hibernate, JDO, and TopLink. JPA is a POJO persistence API for object-relational mapping, which uses metadata annotations to define mappings between Java objects and a relational database. JPA supports class SQL languages for static and dynamic queries. JPA is integrated into the Jsr220:enterprise JavaBeans V3.0 specification.

This article uses a trial version of the WebSphere Application server and DB2 database, but the techniques discussed here can be applied to the Community edition of WebSphere Application Server and DB2. The beta version of WebSphere application Server contains free support. The community version of WebSphere application Server also has support.

Environmental preparedness

Download and install the WebSphere application Server V7.

Download and install the Eclipse IDE for Java EE developers.

Download and install DB2 V9.5.

Create a data instance sample in DB2.

Configuring WebSphere and DB2

Start the WebSphere application Server. In the Steps Console, select the Start server. The WebSphere server is started, as shown in Figure 1.

Figure 1. Start WebSphere v7 Application Server

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.