Top Description Constructors Methods
com.mysql.cj.xdevapi

public Class SessionFactory

extends Object
Class Inheritance
Imports
java.util.List, .Properties, com.mysql.cj.Messages, com.mysql.cj.conf.ConnectionUrl, .HostInfo, .PropertyDefinitions, .PropertyKey, com.mysql.cj.exceptions.CJCommunicationsException, .CJException, .ExceptionFactory, .InvalidConnectionAttributeException

SessionFactory is used for creation of sessions.
SessionFactory xFactory = new SessionFactory();

Session session1 = xFactory.getSession("mysqlx://[user1[:pwd1]@]host1[:port1]/db");
Session session2 = xFactory.getSession("mysqlx://host2[:port2]/db?user=user2&password=pwd2");
Session session3 = xFactory.getSession("mysqlx+srv://[user1[:pwd1]@]service_name/db");

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected Session

Returns:

a Session instance.
getSession
(ConnectionUrl
the session ConnectionUrl.
connUrl
)

Creates Session by given URL.

public Session

Returns:

a Session instance.
getSession
(String
the session URL.
url
)

Creates Session by given URL.

public Session

Returns:

a Session instance.
getSession
(Properties
the Properties instance that contains the session components.
properties
)

Creates a Session using the information contained in the given properties.

protected ConnectionUrl

Returns:

a ConnectionUrl instance containing the URL components.
parseUrl
(String
the connection string URL.
url
)

Parses the connection string URL.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

SessionFactoryback to summary
public SessionFactory()

Method Detail

getSessionback to summary
protected Session getSession(ConnectionUrl connUrl)

Creates Session by given URL.

Parameters
connUrl:ConnectionUrl

the session ConnectionUrl.

Returns:Session

a Session instance.

getSessionback to summary
public Session getSession(String url)

Creates Session by given URL.

Parameters
url:String

the session URL.

Returns:Session

a Session instance.

getSessionback to summary
public Session getSession(Properties properties)

Creates a Session using the information contained in the given properties.

Parameters
properties:Properties

the Properties instance that contains the session components.

Returns:Session

a Session instance.

parseUrlback to summary
protected ConnectionUrl parseUrl(String url)

Parses the connection string URL.

Parameters
url:String

the connection string URL.

Returns:ConnectionUrl

a ConnectionUrl instance containing the URL components.