• 2025-06-01

JDBC Driver-Based Connection Pooling 2 – JDBC API and JDBC Drivers

Figure 3.8 shows a piece of example code to illustrate how to use the connection pooling API to create and deploy a DataSource object that an application can use to get pooled connections to the database. The first codeline is used to create a new ConnectionPoolDataSource object, and this object is equivalent to a pool…

Explore More

JDBC Driver-Based Connection Pooling – JDBC API and JDBC Drivers

3.5.2   JDBC Driver-Based Connection Pooling By using a DataSource object, you can easily set up a connection with your database and perform any data operation you want. Sounds good! Yes, this kind of operation is good for two-tier database applications without problems. However, a problem would occur if you applied this operation in a three-tier…

Explore More

Distributed Transactions – JDBC API and JDBC Drivers

3.5.3   Distributed Transactions A distributed transaction, sometimes referred to as a global transaction, is a set of two or more related transactions that must be managed in a coordinated way. The transactions that constitute a distributed transaction might be in the same database but more typically are in different databases and often in different locations.…

Explore More

The Distributed Transaction Process – JDBC API and JDBC Drivers

3.5.3.2   The Distributed Transaction Process The transaction manager is the primary component of the distributed transaction infrastructure; how-ever, the JDBC driver and application server components should have the following characteristics: The first step of the distributed transaction process is to send a request to the transaction manager by the application. Although the final commit/rollback decision…

Explore More

JDBC RowSet – JDBC API and JDBC Drivers

3.5.4   JDBC RowSet A JDBC RowSet object is one of the JavaBeans components with multiple support from JavaBeans, and it is a new feature in the java.sql package. By using the RowSet object, a database query can be performed automatically with the data source connection and query statement creation. In this section, we will provide…

Explore More

Implementation Process of a RowSet Object – JDBC API and JDBC Drivers

3.5.4.2   Implementation Process of a RowSet Object Generally, the operational procedure of using a RowSet object to query data can be divided into the following four steps: 1) Set up and conFigure a RowSet object. 2) Register the RowSet Listeners. 3) Set input and output parameters for the query command. 4) Traverse through the result…

Explore More

CHAPTER SUMMARY – JDBC API and JDBC Drivers

3.6   CHAPTER SUMMARY This chapter discusses the fundamentals of JDBC and the JDBC API, which include an overview of the JDBC and the JDBC API, JDBC drivers and related components used in the JDBC API. The JDBC components and architecture are discussed and analyzed in detail in the first part of this chapter. All classes…

Explore More

JDBC APPLICATION MODELS – JDBC Applications and Design Considerations

4.1   JDBC APPLICATION MODELS The JDBC API supports both two-tier and three-tier models for database accesses. In a two-tier model, a Java application or an applet can communicate directly with the database. In a three-tier model, commands are sent to a middle tier, which sends the messages to the data-base. In return, the result of…

Explore More

Three-Tier Client-Server Model – JDBC Applications and Design Considerations

4.1.2   Three-Tier Client-Server Model In a three-tier client-server model, a data action request comes from an application GUI and is sent to the application server that can be considered a middle tier, and the application server that contains the JDBC API then sends Oracle statements to the database located on a database server. When the…

Explore More