About EJB (3)

Source: Internet
Author: User
Thirteen J2EE technologies
Java database connection (JDBC)
The jdbc api accesses various databases in a unified manner. Similar to ODBC, JDBC isolates issues between developers and private databases. Since it is built on Java, JDBC can provide platform-independent database access.
JDBC defines four different drivers, including:
Type 1: JDBC-ODBC Bridge
The JDBC-ODBC bridge is very useful when JDBC is just generated. With this feature, developers can use JDBC to access an ODBC data source. The disadvantage is that it needs to install an ODBC driver on the client machine, which should usually run on Microsoft Windows. With this type of drive, you will lose the benefits unrelated to the JDBC platform. In addition, the ODBV drive needs to be managed by the client.
Type 2: JDBC-native drive axle
The JDBC-native drive axle provides a JDBC interface built on the local database driver-ODBC is not used. The JDBC driver converts standard JDBC calls to local calls to database APIs. If Type 2 is used, the benefits of JDBC platform independence will also be lost, and local code of the client needs to be installed.
Type 3: JDBC-network Bridge
JDBC-network bridge does not require the database driver of the client. They use the network-server middle layer to access a database. This will introduce technologies such as server load balancer and connection pool, and data buffering is also possible. The driver of type 3 usually has a relatively small download time. It is platform-independent and does not require client installation and management. Therefore, it is suitable for Internet applications.
Type 4: pure Java driver
Type 4 uses a Java-only database driver to provide direct database access. Because the Type 4 driver runs on the client and directly accesses the database, running in this mode implies a two-tier system. To use a 4-type driver in an n-layer system, you can use an EJB containing data access code to provide a database-independent service to its customers.
Java Naming and Directory interfaces (Java Naming and Directory interfaces, JNDI)
JNDI is short for Java Naming and Directory Interface. It is a Java Naming and Directory Interface. It is used to access the basic structure of directories used in advanced network application development. In fact, this directory is a special database that provides quick access to stored data, unlike traditional directory service access methods-you must provide different API interfaces to access different directory services (such as LDAP, NIS, ADS, and so on ), it provides a standard API to access different directories. It is said that using the complete SDK can develop directory service providers that do not yet support JNDI.
JNDI is an API of J2EE. It provides a set of standard interfaces to locate users, machines, networks, objects, and services. For example, you can use JNDI to locate a printer in the intranet, or you can use it to locate a Java object or connect to a database. JNDI can be used in EJB, RMI-IIOP, and JDBC. It is a standard method for searching and locating networks.

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.