Top Description Constructors Methods
com.mysql.cj.xdevapi

public Class ClientFactory

extends Object
Class Inheritance
Imports
java.util.Properties

ClientFactory is used for creation of Client instances. Client objects provide the means of creating Sessions that use an internally managed connection pool.
ClientFactory xClientFactory = new ClientFactory();

Client client1 = xClientFactory.getClient("mysqlx://[user1[:pwd1]@]host1[:port1]/db", poolingProps);
Client client2 = xClientFactory.getClient("mysqlx://host2[:port2]/db?user=user2&password=pwd2", poolingProps);

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Client

Returns:

a Client instance
getClient
(String
the session URL.
url
,
String
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
}
           
clientPropsJson
)

Creates a Client object which provides a Session pooling functionality.

public Client

Returns:

a Client instance.
getClient
(String
the session URL.
url
,
Properties
the Properties instance that contains the connection properties. The keys in this Properties match with the path of each value in the JSON document from getClient(String, String) (for example, pooling.enabled or pooling.maxSize).
clientProps
)

Creates a Client object that provides a Session pooling functionality.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ClientFactoryback to summary
public ClientFactory()

Method Detail

getClientback to summary
public Client getClient(String url, String clientPropsJson)

Creates a Client object which provides a Session pooling functionality.

Parameters
url:String

the session URL.

clientPropsJson:String

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
}
           
Returns:Client

a Client instance

getClientback to summary
public Client getClient(String url, Properties clientProps)

Creates a Client object that provides a Session pooling functionality.

Parameters
url:String

the session URL.

clientProps:Properties

the Properties instance that contains the connection properties. The keys in this Properties match with the path of each value in the JSON document from getClient(String, String) (for example, pooling.enabled or pooling.maxSize).

Returns:Client

a Client instance.