Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Practice the connection method of DB

2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Today, test the connection mode of java DB.

As far as I know, there are two kinds of things:

ConnectionPoolDataSource

PooledConnection getPooledConnection () attempts to establish a physical database connection that can be used as a pooled connection

PooledConnection getPooledConnection (String usr,String password) attempts to establish a physical database connection that can be used as a pooled connection

Interface DataSource

Basic implementation-generate standard Connection objects

Connection pooling implementation-generates Connection objects that automatically reference jade connection pooling, which is used with the middle-tier connection pooling manager

Distributed transaction implementation-generates a Connection object that can be used for distributed transactions and always participates in connection pooling in most cases. This implementation is used with the middle-tier transaction manager and, in most cases, with the connection pool manager.

The properties of the DataSource object can be modified if necessary. For example, if you move the data source to another server, you can change server-related properties. The advantage is that because you can change the properties of the data source, any code that accesses the data source does not need to change

The driver accessed through the DataSource object itself does not register with DriverManager to get the DataSource object through the lookup operation, and then uses this object to create the Connection object using the basic implementation, and the connection obtained through the DataSource object is the same as the connection obtained through the DriverManager facility.

DataSource's own method

Boolean isWrappseFor (Class iface)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report