Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
defaultSchemaName |
protected MysqlxSession |
session |
Modifier | Constructor and Description |
---|---|
protected |
SessionImpl() |
|
SessionImpl(HostInfo hostInfo)
Constructor.
|
|
SessionImpl(XProtocol prot) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close this session.
|
void |
commit()
Commit the transaction.
|
Schema |
createSchema(java.lang.String schemaName)
Create and return a new schema with the name given by name.
|
Schema |
createSchema(java.lang.String schemaName,
boolean reuseExistingObject)
Create and return a new schema with the name given by name.
|
void |
dropSchema(java.lang.String schemaName)
Drop the existing schema with the name given by name.
|
Schema |
getDefaultSchema()
Retrieve the default schema which may be configured at connect time.
|
java.lang.String |
getDefaultSchemaName()
Retrieve the default schema name which may be configured at connect time.
|
Schema |
getSchema(java.lang.String schemaName)
Retrieve the Schema corresponding to name.
|
java.util.List<Schema> |
getSchemas()
Retrieve the list of Schema objects for which the current user has access.
|
MysqlxSession |
getSession() |
java.lang.String |
getUri()
Get the URL used to create this session.
|
boolean |
isOpen()
Is this session open?
|
void |
releaseSavepoint(java.lang.String name)
Releases the named savepoint.
|
void |
rollback()
Rollback the transaction.
|
void |
rollbackTo(java.lang.String name)
Rolls back the transaction to the named savepoint.
|
java.lang.String |
setSavepoint()
Creates a transaction savepoint with an implementation-defined generated name and returns its name, which can be used in
Session.rollbackTo(String) or
Session.releaseSavepoint(String) . |
java.lang.String |
setSavepoint(java.lang.String name)
Creates or replaces a transaction savepoint with the given name.
|
SqlStatementImpl |
sql(java.lang.String sql)
Create a native SQL command.
|
void |
startTransaction()
Start a new transaction.
|
protected MysqlxSession session
protected java.lang.String defaultSchemaName
public SessionImpl(HostInfo hostInfo)
hostInfo
- HostInfo
instancepublic SessionImpl(XProtocol prot)
protected SessionImpl()
public java.util.List<Schema> getSchemas()
Session
getSchemas
in interface Session
public Schema getSchema(java.lang.String schemaName)
Session
public java.lang.String getDefaultSchemaName()
Session
getDefaultSchemaName
in interface Session
public Schema getDefaultSchema()
Session
getDefaultSchema
in interface Session
Schema
public Schema createSchema(java.lang.String schemaName)
Session
createSchema
in interface Session
schemaName
- name of schema to createSchema
createdpublic Schema createSchema(java.lang.String schemaName, boolean reuseExistingObject)
Session
createSchema
in interface Session
schemaName
- name of schema to createreuseExistingObject
- true to reuseSchema
createdpublic void dropSchema(java.lang.String schemaName)
Session
dropSchema
in interface Session
schemaName
- name of schema to droppublic void startTransaction()
Session
startTransaction
in interface Session
public void commit()
Session
public void rollback()
Session
public java.lang.String setSavepoint()
Session
Session.rollbackTo(String)
or
Session.releaseSavepoint(String)
. Calling this method more than once should always work. The generated name shall be unique per session.setSavepoint
in interface Session
public java.lang.String setSavepoint(java.lang.String name)
Session
setSavepoint
in interface Session
name
- savepoint namepublic void rollbackTo(java.lang.String name)
Session
rollbackTo
in interface Session
name
- savepoint namepublic void releaseSavepoint(java.lang.String name)
Session
releaseSavepoint
in interface Session
name
- savepoint namepublic java.lang.String getUri()
Session
public boolean isOpen()
Session
public void close()
Session
public SqlStatementImpl sql(java.lang.String sql)
Session
sql
in interface Session
sql
- native SQL statementSqlStatement
public MysqlxSession getSession()