1 Ocak 2019 Salı

JDBC PooledConnection Arayüzü

Giriş
Şu satırı dahil ederiz 
import javax.sql.PooledConnection;
XAConnection bu arayüzden kalıtır. 

Açıklaması şöyle.
An application programmer does not use the PooledConnection interface directly; rather, it is used by a middle tier infrastructure that manages the pooling of connections.
When an application calls the method DataSource.getConnection, it gets back a Connection object. If connection pooling is being done, that Connection object is actually a handle to a PooledConnection object, which is a physical connection.
The connection pool manager, typically the application server, maintains a pool of PooledConnection objects ....
Bu arayüzü gerçekleştiren bazı sınıflar şöyle
com.microsoft.sqlserver.jdbc.SQLServerPooledConnection;
com.mysql.cj.jdbc.MysqlPooledConnection
org.postgresql.ds.PGPooledConnection;
getConnection metodu
Açıklaması şöyle.
A PooledConnection provides a getConnection for obtaining a logical java.sql.Connection that the connection pool can hand out to a user code, in addition it supports listeners so the connection pool can monitor usage of statements and the logical connection. This API is also useful for a transaction manager.


Hiç yorum yok:

Yorum Gönder