⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 overview7.html

📁 j2eePDF格式的电子书
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">  <head>    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />    <meta http-equiv="Content-Style-Type" content="text/css" />    <title>J2EE APIs</title>    <link rel="StyleSheet" href="document.css" type="text/css" media="all" />    <link rel="StyleSheet" href="catalog.css" type="text/css" media="all" />    <link rel="Table of Contents" href="J2EETutorialTOC.html" />    <link rel="Previous" href="Overview6.html" />    <link rel="Next" href="IntroXML.html" />    <link rel="Index" href="J2EETutorialIX.html" />  </head>  <body>    <table width="550" summary="layout" id="SummaryNotReq1">      <tr>	<td align="left" valign="center">	<font size="-1">	<a href="http://java.sun.com/j2ee/1.4/download.html#tutorial" target="_blank">Download</a>	<br>	<a href="http://java.sun.com/j2ee/1.4/docs/tutorial/information/faq.html" target="_blank">FAQ</a>	<br>	<a href="http://java.sun.com/j2ee/1.4/docs/tutorial/information/history.html" target="_blank">History</a>	</td>        <td align="center" valign="center"><a accesskey="p" href="Overview6.html"><img id="LongDescNotReq1" src="images/PrevArrow.gif" width="26" height="26" border="0" alt="Prev" /></a><a accesskey="c" href="J2EETutorialFront.html"><img id="LongDescNotReq1" src="images/UpArrow.gif" width="26" height="26" border="0" alt="Home" /></a><a accesskey="n" href="IntroXML.html"><img id="LongDescNotReq3" src="images/NextArrow.gif" width="26" height="26" border="0" alt="Next" /></a><a accesskey="i" href="J2EETutorialIX.html"></a>        </td>	<td align="right" valign="center">	<font size="-1">	<a href="http://java.sun.com/j2ee/1.4/docs/api/index.html" target="_blank">API</a>	<br>	<a href="http://java.sun.com/j2ee/1.4/docs/tutorial/information/search.html" target="_blank">Search</a>	<br>	<a href="http://java.sun.com/j2ee/1.4/docs/tutorial/information/sendusmail.html" target="_blank">Feedback</a></font>	</font>	</td>      </tr>    </table>    <img src="images/blueline.gif" width="550" height="8" ALIGN="BOTTOM" NATURALSIZEFLAG="3" ALT="Divider">    <blockquote><a name="wp79948"> </a><h2 class="pHeading1">J2EE APIs</h2><a name="wp79950"> </a><h3 class="pHeading2">Enterprise JavaBeans Technology</h3><a name="wp79951"> </a><p class="pBody">An Enterprise JavaBeans<img src="images/tm.gif" border="0" alt="Trademarked"> (EJB<img src="images/tm.gif" border="0" alt="Trademarked">) component or <em class="cEmphasis">enterprise bean</em> is a body of code with fields and methods to implement modules of business logic. You can think of an enterprise bean as a building block that can be used alone or with other enterprise beans to execute business logic on the J2EE server. </p><a name="wp79952"> </a><p class="pBody">There are three kinds of enterprise beans: session beans, entity beans, and message-driven beans. Enterprise beans often interact with databases. One of the benefits of entity beans is that you do not have to write any SQL code or use the JDBC<img src="images/tm.gif" border="0" alt="Trademarked"> API directly to perform database access operations; the EJB container handles this for you. However, if you override the default container-managed persistence for any reason, you will need to use the JDBC API. Also, if you choose to have a session bean access the database, you have to use the JDBC&nbsp;API.</p><a name="wp79954"> </a><h3 class="pHeading2">JDBC API</h3><a name="wp79957"> </a><p class="pBody">The JDBC<img src="images/tm.gif" border="0" alt="Trademarked"> API lets you invoke SQL commands from Java programing language methods. You use the JDBC API in an enterprise bean when you override the default container-managed persistence or have a session bean access the database. With container-managed persistence, database access operations are handled by the container, and your enterprise bean implementation contains no JDBC code or SQL commands. You can also use the JDBC API from a servlet or JSP page to access the database directly without going through an enterprise bean.</p><a name="wp79958"> </a><p class="pBody">The JDBC API has two parts: an application-level interface used by the application components to access a database, and a service provider interface to attach a JDBC driver to the J2EE platform.</p><a name="wp79959"> </a><h3 class="pHeading2">Java Servlet Technology</h3><a name="wp79961"> </a><p class="pBody">Java Servlet technology lets you define HTTP-specific servlet classes. A servlet class extends the capabilities of servers that host applications accessed by way of a request-response programming model. Although servlets can respond to any type of request, they are commonly used to extend the applications hosted by Web servers.</p><a name="wp79962"> </a><h3 class="pHeading2">JavaServer Pages Technology</h3><a name="wp79964"> </a><p class="pBody">JavaServer Pages<img src="images/tm.gif" border="0" alt="Trademarked"> (JSP<img src="images/tm.gif" border="0" alt="Trademarked">) technology lets you put snippets of servlet code directly into a text-based document. A JSP page is a text-based document that contains two types of text: static template data, which can be expressed in any text-based format such as HTML, WML, and XML, and JSP elements, which determine how the page constructs dynamic content.</p><a name="wp79965"> </a><h3 class="pHeading2">Java Message Service</h3><a name="wp84001"> </a><p class="pBody">The Java Message Service (JMS) is a messaging standard that allows J2EE application components to create, send, receive, and read messages. It enables distributed communication that is loosely coupled, reliable, and asynchronous. </p><a name="wp84004"> </a><h3 class="pHeading2">Java Naming and Directory Interface</h3><a name="wp79972"> </a><p class="pBody">The Java Naming and Directory Interface<img src="images/tm.gif" border="0" alt="Trademarked"> (JNDI) provides naming and directory functionality. It provides applications with methods for performing standard directory operations, such as associating attributes with objects and searching for objects using their attributes. Using JNDI, a J2EE application can store and retrieve any type of named Java object. </p><a name="wp83878"> </a><p class="pBody">J2EE naming services provide application clients, enterprise beans, and Web components with access to a JNDI naming environment. A <em class="cEmphasis">naming environment </em>allows a component to be customized without the need to access or change the component&#39;s source code. A container implements the component's environment and provides it to the component as a JNDI <code class="cCode">naming context</code>.</p><a name="wp83880"> </a><p class="pBody">A J2EE component locates its environment naming context using JNDI interfaces. A component creates a <code class="cCode">javax.naming.InitialContext</code> object and looks up the environment naming context in <code class="cCode">InitialContext</code> under the name <code class="cCode">java:comp/env</code>. A component's naming environment is stored directly in the environment naming context or in any of its direct or indirect subcontexts.</p><a name="wp83876"> </a><p class="pBody">A J2EE component can access named system-provided and user-defined objects. The names of system-provided objects, such as JTA <code class="cCode">UserTransaction</code> objects, are stored in the environment naming context,<code class="cCode"> java:comp/en</code>v. The J2EE platform allows a component to name user-defined objects, such as enterprise beans, environment entries, JDBC <code class="cCode">DataSource</code> objects, and message connections. An object should be named within a subcontext of the naming environment according to the type of the object. For example, enterprise beans are named within the subcontext <code class="cCode">java:comp/env/ejb</code> and JDBC <code class="cCode">DataSource</code> references in the subcontext <code class="cCode">java:comp/env/jdbc</code>. </p><a name="wp79973"> </a><p class="pBody">Because JNDI is independent of any specific implementations, applications can use JNDI to access multiple naming and directory services, including existing naming and directory services such as LDAP, NDS, DNS, and NIS. This allows J2EE applications to coexist with legacy applications and systems. For more information on JNDI, see the online JNDI Tutorial:</p><div class="pPreformattedRelative"><pre class="pPreformattedRelative"><a  href="http://java.sun.com/products/jndi/tutorial/index.html" target="_blank">http://java.sun.com/products/jndi/tutorial/index.html</a><a name="wp79975"> </a></pre></div><a name="wp79976"> </a><h3 class="pHeading2">Java Transaction API</h3><a name="wp79978"> </a><p class="pBody">The Java Transaction API (JTA) provides a standard interface for demarcating transactions. The J2EE architecture provides a default auto commit to handle transaction commits and rollbacks. An auto commit means that any other applications viewing data will see the updated data after each database read or write operation. However, if your application performs two separate database access operations that depend on each other, you will want to use the JTA API to demarcate where the entire transaction, including both operations, begins, rolls back, and commits.</p><a name="wp79979"> </a><h3 class="pHeading2">JavaMail API</h3><a name="wp79981"> </a><p class="pBody">J2EE applications can use the JavaMail<img src="images/tm.gif" border="0" alt="Trademarked"> API to send e-mail notifications. The JavaMail API has two parts: an application-level interface used by the application components to send mail, and a service provider interface. The J2EE platform includes JavaMail with a service provider that allows application components to send Internet mail. </p><a name="wp79982"> </a><h3 class="pHeading2">JavaBeans Activation Framework</h3><a name="wp79984"> </a><p class="pBody">

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -