public class SessionFactory extends Object
SessionFactory xFactory = new SessionFactory();Sessionsession1 = xFactory.getSession("mysqlx://[user1[:pwd1]@]host1[:port1]/db");Sessionsession2 = xFactory.getSession("mysqlx://host2[:port2]/db?user=user2&password=pwd2");Sessionsession3 = xFactory.getSession("mysqlx+srv://[user1[:pwd1]@]service_name/db");
| Constructor and Description |
|---|
SessionFactory() |
| Modifier and Type | Method and Description |
|---|---|
protected Session |
getSession(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 ConnectionUrl |
parseUrl(String url)
Parses the connection string URL.
|
protected ConnectionUrl parseUrl(String url)
url - the connection string URL.ConnectionUrl instance containing the URL components.protected Session getSession(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.