2. Using the Tutorial Examples 3. Getting Started with Web Applications 5. JavaServer Pages Technology 7. JavaServer Pages Standard Tag Library 10. JavaServer Faces Technology 11. Using JavaServer Faces Technology in JSP Pages 12. Developing with JavaServer Faces Technology 13. Creating Custom UI Components 14. Configuring JavaServer Faces Applications 15. Internationalizing and Localizing Web Applications 16. Building Web Services with JAX-WS 17. Binding between XML Schema and Java Classes 19. SOAP with Attachments API for Java 21. Getting Started with Enterprise Beans 23. A Message-Driven Bean Example 24. Introduction to the Java Persistence API 25. Persistence in the Web Tier 26. Persistence in the EJB Tier 27. The Java Persistence Query Language 28. Introduction to Security in the Java EE Platform 29. Securing Java EE Applications 31. The Java Message Service API 32. Java EE Examples Using the JMS API Theconfirmer Example Application Running theconfirmer Example Application Building, Packaging, and Deployingconfirmer in NetBeans IDE Building, Packaging, and Deployingconfirmer Using Ant Running theconfirmer Client in NetBeans IDE Running theconfirmer Client Using Ant Further Information about Resources 36. The Coffee Break Application | DataSource Objects and Connection PoolsTo store, organize, and retrieve data, most applications use a relational database. JavaEE 5 components may access relational databases through the JDBC API. For information onthis API, seehttp://www.oracle.com/technetwork/java/javase/tech/index-jsp-136101.html. In the JDBC API, databases are accessed by usingDataSource objects. ADataSource hasa set of properties that identify and describe the real world data sourcethat it represents. These properties include information such as the location of thedatabase server, the name of the database, the network protocol to use tocommunicate with the server, and so on. In the Application Server, a datasource is called a JDBC resource. Applications access a data source using a connection, and aDataSource objectcan be thought of as a factory for connections to the particular datasource that theDataSource instance represents. In a basicDataSource implementation, a call tothegetConnection method returns a connection object that is a physical connection tothe data source. If aDataSource object is registered with a JNDI naming service, an applicationcan use the JNDI API to access thatDataSource object, which canthen be used to connect to the data source it represents. DataSource objects that implement connection pooling also produce a connection to the particulardata source that theDataSource class represents. The connection object that thegetConnectionmethod returns is a handle to aPooledConnection object rather than being a physicalconnection. An application uses the connection object in the same way that ituses a connection. Connection pooling has no effect on application code except thata pooled connection, like all connections, should always be explicitly closed. When anapplication closes a connection that is pooled, the connection is returned to apool of reusable connections. The next timegetConnection is called, a handle toone of these pooled connections will be returned if one is available. Because connectionpooling avoids creating a new physical connection every time one is requested, applicationscan run significantly faster. A JDBC connection pool is a group of reusable connections for aparticular database. Because creating each new physical connection is time consuming, the server maintainsa pool of available connections to increase performance. When an application requests aconnection, it obtains one from the pool. When an application closes a connection,the connection is returned to the pool. Applications that use the Persistence API specify theDataSource object they areusing in thejta-data-source element of thepersistence.xml file. <jta-data-source>jdbc/MyOrderDB</jta-data-source> This is typically the only reference to a JDBC object for apersistence unit. The application code does not refer to any JDBC objects. Formore details, seePersistence Units. Copyright © 2010, Oracle and/or its affiliates. All rights reserved.Legal Notices |