Access Technology of Java database

Source: Internet
Author: User
Tags rounds

It technology is changing rapidly, and new technologies appear to be dizzying, and every day seems to be producing a term. Ultimately, however , IT is the value of the data that is collected and then presented to the customer in the form that the customer wants. Therefore, data access technology has become an eternal topic. In the open world of Java, database access technology is diverse and varied. We also come to regaling The mainstream database access technology in the Java world.

First Lists the Heroes list

1. JDBC Direct Access to the database

2. EJB entity Bean.

3. JDO technology.

4. Third-party o/R tools, such as the current rounds Hibernate, Others such as Castor, Toplink.

Let's talk about this oldestJDBCit. FromJavaThe day he was born, the man began to climb the stage of history. JavaIt's so beautiful today,JDBCIt can be said that the work is not the end. Along the way, now isJDBC3.0up. In noJDBC, access to the database that is eight Immortals crossing, recount, all the database manufacturers have their own set ofAPI,suffering on the development staff. Change a database, that program to change is beyond recognition. JDBCthe promulgation of the specification, to the world announced that there is a standard universal interface to access the relational database. JDBCstandards have been supported by almost all database vendors, as if it's really hard to find such a database, it's notJDBCsupported. JDBConce published, the specification gained unprecedented success and soon becameJavathe standard for accessing the database. JDBCthe success lies in its standardized standard interface, only need to master the standardSQLlanguages can access a variety of different databases. This kind of database portability andJavaslogans that have been shoutingCompile Once, Run everywhereEcho. JDBCtoday is stillJavaaccess to the cornerstone of the database,CMP, JDO, Hibernatein the end, it's just better encapsulation.JDBC,provides a more powerful interface to the upper layer. And talk about it.JDBCdirect access to the database in a way that implementsJavadurability.

This approach is relative toCMPsimpler and more straightforward, especially for small applications. For example, I want to write a simple message version of the program, there is no needsession bean, entity Bean, but alsoHomeThe interface is also a remote interface, a layer of layer tune it. DirectlyJDBC,WriteSQLstatement. Compared with other persistence technologies,JDBCdirect access to the database requires programmers to worry about things a little more, you have to care aboutTransaction,Self Care Connection pool you have to write a lot ofGet Setmethod, putSQL Selectout of the values one by one stuffed into yourJava Object, or putJava ObjectThe value is taken out one by one, withSQL Insertto the database, completely manuallyO/R mapping. To overcome these shortcomings,CMP, JDOand so on began to climb the historical stage.

Doeasy to use is the most praised, do not need you to write a lot of useless interfaces, do not need you to inherit any special class, the only thing to do is to yourclassfile for a moment.Enhance. Used aJDO,can say ourJavaprogram This under the realOO, we don't have to listen to any tables in the database, and access isJava Objectis an object, all database tables are automatically generated. This can be said to be a revolution. Prior to this, the project design phase,Database Schemadesign can be said to be a highlight. And now withJDOdevelopment, without the need for database design at all. So, yourDatabase Schemait? That's yours.ClassAh,JDOwill be based on yourClassthe corresponding database tables are automatically generated. A word, cool! From the perspective of database portability,JDOIt's an obvious advantage, I've used it.Kodoand theGenieSee, a few simple applications in exchange for a databaseJDBC driver,Change the databaseURL,There is no need to make any changes to the program. This is the pointEJBis at a disadvantage. Judging from family background,JDOis also a well-born, from the outset inJCPunder management. From an enterprise-level support perspective, it can be very good andSession Beanwork together, for enterprise-level development,Session Bean + JDOthe way isSession Bean + entitya powerful competitor of the way. Although there are so many advantages, but its development path is not smooth sailing, this is not, this MayJDO2.0's vote,IBM, Oracle, BeaThe three Giants also voted against the vote. But just a little bit, it's understandable, it's notJDOwhat are the major flaws in their technology, butJDOmove to the cheese of these giants. Bea, IBMbeing the most famous application server in the industry,WebLogicand theWebSphere,in theEJBIt was a drop of money , and they couldn't watch it.JDOto NibbleEJBmarket. andOracle,still selling its own.O/RToolsToplink,look at that.JDOgrowing strong, he can not worry about it. However, the company again cattle, he also can not stop the history of the wheel bar, eventuallyJDO2.0vote or the absolute number of votes ( A:3) passed.

There are other scattered rivers and lakes.Javapersistence technology, such asHibernate, Castor, Toplink,Although they do not have royal blood, but the strength is not to be underestimated. Just takeHibernatespeaking, isJavaworldvoted out of2003Best of the yearJavaThe data Access tool, which can now be said to be rounds. andCastorand theToplinkis also a long history, inJDObefore they were born, they were mixed up in the lake. At present, also occupy a certain market. These third-party tools are functionally similar toJDO,just their own.APIdifferent. This is also the laterJDOa reason for the ever-higher demands of the norm. These third-partyO/R mappingtools can be based on the lake, and indeed have their own extraordinary place. AsHibernateThe flagship isOpen Source, supporting the vast majority of databases that can be seen almost on the world, and the documentation is very complete. Toplink, it is a long history, but also the list ofOraclethis big tree. For now, these tools also occupyJavaa small market for database access. Personally feel that withJDOthe standard is not perfect,JDOThe popularity of the product, this part of the staff may gradually withdraw from the historical stage in the future. But fromHibernateat present the momentum of the heyday, it seems that this sentence is too early.

The pros and cons of these technologies have never stopped from the day they were born, and the factions have never been able to persuade each other. For our application developers, it doesn't make much sense to put aside the application purely to argue the pros and cons of technology. Or as the saying goes, there is no best, only the most suitable. We are able to choose a technology that is best suited to your application when doing development, which is enough. OverallJDBCforRDBMS,compare applications that are suitable for relational database schema driven, such as statistical tabular data, to generate reports. EJBTechnology toJavaApplication Server-centric, if your application does require flexible and declarative transaction boundaries, requires support for large-capacity access and uninterrupted service, requires cluster of application servers, then selectEJBit. JDOthe object-oriented, for the domain object-centric application, including graph, tree model of the application,JDOis preferred.


Access Technology of Java database

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.