IT technology is changing with each passing day, and the emergence of new technologies is dazzling. It seems that every day there are new terms. However, the value IT needs to achieve is nothing more than data collection, which is then presented to the customer in the form desired by the customer. Therefore, data access technology has become an eternal topic. In the open world of Java, database access technology is varied and varied. We also come to ridicule the mainstream database access technologies in the Java world.
First, list the heroes
1. Direct JDBC access to the database
2. EJB entity bean.
3. JDO technology.
4. Third-party O/R tools, such as Hibernate, other such as Castor and Toplink.
Let's talk about JDBC, which has a long history. From the day when Java was born, this elder brother began to enter the stage of history. If Java is so elegant today, JDBC can be said to be an indispensable task. It's already JDBC3.0. In the absence of JDBC, accessing the database is an amazing way. Every database vendor has its own set of APIs, so developers suffer. With a database, the program should be completely different. The introduction of the JDBC specification announced to the world that there was a standard and common interface for accessing relational databases. The JDBC standard has been supported by almost all database vendors. It seems difficult to find such a database. It does not support JDBC. Once released, the JDBC specification was an unprecedented success and soon became the standard for java database access. The success of JDBC lies in its standardized and standardized interfaces. You only need to master the standard SQL language to access different databases. This kind of portability between databases is similar to that of Java's popular slogan Compile Once, Run everywhere. Today, JDBC is the cornerstone for java to access the database. CMP, JDO, and Hibernate only better encapsulate JDBC and provide more powerful interfaces at the upper layer. Then let's talk about how JDBC directly accesses the database to implement java persistence.
This method is relatively simple and direct relative to CMP, especially for small applications. For example, if I want to write a simple message board program, there is no need for session bean, entity bean, home interface and remote interface. Directly write SQL statements in JDBC. Compared with other persistence technologies, there are more things that programmers need to worry about when accessing the database directly through JDBC. You have to worry about transaction and connection pool. You have to write a lot of get set methods, insert the SQL select values to your java object one by one, or obtain the values of the java object one by one, insert the values to the database using SQL, and perform O/R mapping manually. To overcome these shortcomings, CMP, JDO, and so on began to step onto the stage of history.
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