public class SessionFactory extends Object
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 and Description |
---|
SessionFactory() |
Modifier and Type | Method and Description |
---|---|
protected Session |
getSession(com.mysql.cj.conf.ConnectionUrl connUrl)
Creates
Session by given URL. |
Session |
getSession(Properties properties)
Creates a
Session using the information contained in the given properties. |
Session |
getSession(String url)
Creates
Session by given URL. |
protected com.mysql.cj.conf.ConnectionUrl |
parseUrl(String url)
Parses the connection string URL.
|
protected com.mysql.cj.conf.ConnectionUrl parseUrl(String url)
url
- the connection string URL.ConnectionUrl
instance containing the URL components.protected Session getSession(com.mysql.cj.conf.ConnectionUrl connUrl)
Session
by given URL.connUrl
- the session ConnectionUrl
.Session
instance.public Session getSession(String url)
Session
by given URL.url
- the session URL.Session
instance.public Session getSession(Properties properties)
Session
using the information contained in the given properties.properties
- the Properties
instance that contains the session components.Session
instance.