类 ClientFactory
- java.lang.Object
-
- com.mysql.cj.xdevapi.ClientFactory
-
public class ClientFactory extends Object
ClientFactory is used for creation ofClientinstances.Clientobjects provide the means of creatingSessions that use an internally managed connection pool.ClientFactory xClientFactory = new ClientFactory();
Clientclient1 = xClientFactory.getClient("mysqlx://[user1[:pwd1]@]host1[:port1]/db", poolingProps);Clientclient2 = xClientFactory.getClient("mysqlx://host2[:port2]/db?user=user2&password=pwd2", poolingProps);
-
-
构造器概要
构造器 构造器 说明 ClientFactory()
-
-
-
方法详细资料
-
getClient
public Client getClient(String url, String clientPropsJson)
Creates aClientobject which provides a Session pooling functionality.- 参数:
url- the session URL.clientPropsJson- JSON string representing a document that defines connection properties in a special format. For pooling configuration, it should contain an embedded document after the "pooling" key:pooling : { enabled: true|false, maxSize: integer > 0 maxIdleTime: integer ≥ 0, queueTimeOut: integer ≥ 0 }- 返回:
- a
Clientinstance
-
getClient
public Client getClient(String url, Properties clientProps)
Creates aClientobject that provides a Session pooling functionality.- 参数:
url- the session URL.clientProps- thePropertiesinstance that contains the connection properties. The keys in thisPropertiesmatch with the path of each value in the JSON document fromgetClient(String, String)(for example,pooling.enabledorpooling.maxSize).- 返回:
- a
Clientinstance.
-
-