- JDBC 4.0 and Oracle JDeveloper for J2EE Development
- Deepak Vohra
- 522字
- 2021-08-25 18:08:48
Chapter 2. Configuring JDBC in Oracle JDeveloper
Oracle JDeveloper is a free Integrated Development Environment (IDE) for modeling, developing, debugging, optimizing, and deploying Java applications. JDeveloper 10g is used to develop J2EE applications comprising the JSPs, EJBs, Struts, Servlets, and the Java classes that may require accessing a database table in the Oracle 10g Database, or a third-party database. Unlike Eclipse, which requires a plugin, JDeveloper has a built-in provision to establish a JDBC connection with a database. JDeveloper is the only Java IDE with an embedded application server, the Oracle Containers for J2EE (OC4J). This database-based web application may run in JDeveloper without requiring a third-party application server. However, JDeveloper also supports third-party application servers. Starting with JDeveloper 11, application developers may point the IDE to an application server instance (or OC4J instance), including third-party application servers that they want to use for testing during development. JDeveloper provides connection pooling for the efficient use of database connections. A database connection may be used in an ADF BC application, or in a JavaEE application.
A database connection in JDeveloper may be configured in the Connections Navigator. A Connections Navigator connection is available as a DataSource
registered with a JNDI naming service. The database connection in JDeveloper is a reusable named connection that developers configure once and then use in as many of their projects as they want. Depending on the nature of the project and the database connection, the connection is configured in the bc4j.xcfg file or a JavaEE data source. Here, it is necessary to distinguish between data source and DataSource
. A data source is a source of data; for example an RDBMS database is a data source. A DataSource
is an interface that represents a factory for JDBC Connection
objects. JDeveloper uses the term Data Source or data source to refer to a factory for connections. We will also use the term Data Source or data source to refer to a factory for connections, which in the javax.sql
package is represented by the DataSource
interface. A DataSource
object may be created from a data source registered with the JNDI (Java Naming and Directory) naming service using JNDI lookup. A JDBC Connection
object may be obtained from a DataSource
object using the getConnection
method. As an alternative to configuring a connection in the Connections Navigator a data source may also be specified directly in the data source configuration file data-sources.xml
. In this chapter we will discuss the procedure to configure a JDBC connection and a JDBC data source in JDeveloper 10g IDE. We will use the MySQL 5.0 database server and MySQL Connector/J 5.1 JDBC driver, which support the JDBC 4.0 specification. In this chapter you will learn the following:
- Creating a database connection in JDeveloper Connections Navigator
- Configuring the Data Source and Connection Pool associated with the connection configured in the Connections Navigator
- The common JDBC Connection Errors
- Creating a Connection Pool and Data Source
- Connecting to a Database from a Web Application
- The JDBC 4.0 Version of the Web Application
Before we create a JDBC connection and a data source we will discuss connection pooling and DataSource
.
- 剪映短視頻剪輯零基礎(chǔ)一本通
- 數(shù)據(jù)、模型與決策:基于Excel的建模和商務(wù)應(yīng)用
- Oracle SQL Developer 2.1
- PPT 2016幻燈片設(shè)計(jì)與制作從入門到精通
- Mastering phpMyAdmin 3.3.x for Effective MySQL Management
- Tomcat 6 Developer's Guide
- Android從入門到精通
- 中文版Photoshop 2020完全自學(xué)教程
- 用Cubase輕松制作你的短視頻音樂(lè)
- Microsoft Silverlight 5: Building Rich Enterprise Dashboards
- After Effects影視動(dòng)畫特效及欄目包裝案例實(shí)戰(zhàn)
- ICEfaces 1.8: Next Generation Enterprise Web Development
- NX Open API編程技術(shù)
- 中文版Maya 2016基礎(chǔ)培訓(xùn)教程
- 構(gòu)筑敏捷的開發(fā)團(tuán)隊(duì):微軟Visual Studio 2010實(shí)戰(zhàn)兵法