IT technology has no new month, and the emergence of new technologies is a vividness, it seems that every day is a new noun. However, the value of IT to achieve is nothing more than data collection, and then show the customer in the form of customers. Therefore, data access technology has become an eternal topic. In the open world of Java, data inventory is taken in five flowers and a wide variety. We also come to the mainstream data inventory in the Java world. First list the hero list. JDBC directly accesses the database 2. EJB Entity Bean. 3. JDO technology. 4. Third Party O / R Tools, such as the current red big purple hibernate, others such as Castor, Toplink. Let's talk about the most long JDBC. From the day of Java, the people started to board the historical stage. Java can have so scenery today, JDBC can be said to be a function. All the way, now it is JDBC3.0. When there is no JDBC, the access database is the eight fairy, each of them, the database vendors have their own API, bitter, the developer. Changed a database, that program is to change the face. The introduction of JDBC specification has announced the standard universal interface of the access database from now on. The JDBC standard has gained almost all database vendors, it seems to be difficult to find such a database, it is no JDBC support. Once the JDBC specification was released, he obtained unprecedented success and quickly became the standard of Java access to the database. The success of JDBC is that its specifications of the unified standard interface, just master the standard SQL language, you can access a variety of different databases. The portability of this database and Java have been shouting the slogan compile overce, run Everywhere. JDBC today is still the cornerstone of the database, CMP, JDO, Hibernate, which is just a better package of JDBC, which provides a more powerful interface. Then talk about the JDBC directly access the database to implement Java persistence. This approach is relatively straightforward relative to CMP, especially for small applications. For example, I want to write a simple message version, there is no necessary session bean, entity bean, and the HOME interface is a remote interface, and the layer is toned. Direct JDBC, write SQL statement. Compared with other persistence technology, JDBC directly accessing the database requires more things to worry about, you have to care about Transaction, care about the connection pool, you have to write a lot of Get SET methods, put the value of SQL SELECT A one plugged into your java object, or takes one by one of the values of Java Object, with SQL INSERT to the database, fully manually perform O / R mapping. In order to overcome these shortcomings, CMP, JDO, etc. will start to board the historical stage. The following EJB debut, EJB as the core part of the Sun J2EE system, is the first choice for enterprise-level development of Sun, and EJB Entity is still the most recommended Java persistence technique recommended by Sun J2EE White Paper. Entity Bean as part of the EJB specification, is also the most controversial technology in the EJB specification. It has passed the wind and rain in a few spring and autumn. At present, the draft EJB3.0 specification has been introduced, http: //jcp.org/en/jsr/detail? Id = 220. From a family birth, EJB can be described as rooted seedlings, which are specified below JCP management, with super luxurious expert group members, Sun, IBM, Oracle, Borland, BEA, SAP, JBOSS, APACHE Software Fund, and more.
From this point of view, choose it as an enterprise-level development, technical support should not worry. Of course, IBM, BEA, etc. seek project consultations, of course, is of course not. From the provision of functions, EJB Entity has experienced EJB1.0, EJB1.1, EJB2.0, and the function is also more complete. Includes perfect transaction support, EJBQL query language, transparent distributed access, etc. However, as a heavyweight technology, the performance of Entity Bean is not very satisfactory, which has become a focus of controversial, I don't know if this situation will be improved after 3.0. There is another one, it is powerful, but for ease of use, it is really darentry, write a simple bean, also not to HOME interface, remote interface, to add 2.0 local interface after 2.0, such Linlin President A lot of pile is enough to let Java beginners are just a step. But this has become a "evolution" of the EJB function and high technology in a period of time. I remember that I have just graduated in the past many years, EJB applications are still relatively small, and there are no people in the company. Why EJB is a problem. Anyway, anyone who uses EJB is a cattle project. People with EJB are cattle, divided into EJB project groups. The brothers walked up and looked up, and they were still in JDBC, and SQL people were as high. EJB technology is currently in full entrainment of most Jiangshan, the boss is difficult to move in a short time. The following new generation represents JDO debut, JDO is absolutely in the oversal player, JDO1.0 is not released in April 2002. In May 2003, 1.0.1 was introduced, and the latest 2.0 draft has been released. In this 2.0, the discussion on the rivers and lakes can be said to be "bloody winds", two major arms, JDO Corps and EJB Corps will not be available. Interested, may wish to go, there is no shortage of heavyweight. From this point of view, it can produce such a big impact on EJB, which means that this new births are more than people. JDO has brought a lot of new features to Java data persistence, especially it makes up for EJB's innate shortcomings for OO programming, and JDO provides complete OO support, inheritance, and polymorphism. JDO and EJB ratios are lightweight tools, no container support. Unlike EJB, you have to use you, you will not have a whole weblogic, WebSphere. JDO is the most important thing, no need to write a lot of useless interfaces, do not need you inherit what special classes, the only thing to do is to do enhance for your class file. Used JDO, you can say that our Java program is really OO, we don't have to pay back the form in the database, access is subject to Java Object, and all database tables are automatically generated. This can be said to be a revolution. Prior to this, the project design phase, Database Schema design can be said to be a heavy action. Now use JDO development, it does not require a database design. What about your Database Schema? Is your class, JDO automatically generates the corresponding database table according to your class. One word, cool! From the perspective of database portability, JDO is also an advantage. For the KODO and Genie I have used, several simple application changes the database, in addition to change a JDBC Driver, change the database URL, there is no need to make any changes to the program. This is a disadvantage to EJB. From the family, JDO is also a famous door, from the beginning of JCP management.