Top Description Fields Constructors Methods
com.mysql.cj.xdevapi

public Class SessionImpl

extends Object
implements Session
Class Inheritance
All Implemented Interfaces
com.mysql.cj.xdevapi.Session, java.lang.AutoCloseable
Imports
java.util.List, java.util.function.Function, java.util.stream.Collectors, com.mysql.cj.Messages, .MysqlxSession, com.mysql.cj.conf.ConnectionUrl, .DefaultPropertySet, .HostInfo, .PropertyDefinitions, .PropertyKey, .PropertySet, .RuntimeProperty, com.mysql.cj.exceptions.MysqlErrorNumbers, com.mysql.cj.protocol.x.XMessage, .XMessageBuilder, .XProtocol, .XProtocolError, com.mysql.cj.result.Row, .StringValueFactory, com.mysql.cj.util.StringUtils

Session implementation.

Field Summary

Modifier and TypeField and Description
protected String
protected MysqlxSession
private XMessageBuilder

Constructor Summary

AccessConstructor and Description
public
SessionImpl(HostInfo
HostInfo instance
hostInfo
)

Constructor.

public
protected

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements com.mysql.cj.xdevapi.Session.close.

Close this session.

public void
commit()

Implements com.mysql.cj.xdevapi.Session.commit.

Commit the transaction.

public Schema
createSchema(String
name of schema to create
schemaName
)

Implements com.mysql.cj.xdevapi.Session.createSchema.

Create and return a new schema with the name given by name.

public Schema
createSchema(String
name of schema to create
schemaName
,
boolean
true to reuse
reuseExistingObject
)

Implements com.mysql.cj.xdevapi.Session.createSchema.

Create and return a new schema with the name given by name.

public void
dropSchema(String
name of schema to drop
schemaName
)

Implements com.mysql.cj.xdevapi.Session.dropSchema.

Drop the existing schema with the name given by name.

public Schema
getDefaultSchema()

Implements com.mysql.cj.xdevapi.Session.getDefaultSchema.

Retrieve the default schema name, which might have been configured at the time of connection.

public String
getDefaultSchemaName()

Implements com.mysql.cj.xdevapi.Session.getDefaultSchemaName.

Retrieve the default schema name, which might have been configured at the time of connection.

public Schema
getSchema(String
name of schema to retrieve
schemaName
)

Implements com.mysql.cj.xdevapi.Session.getSchema.

Retrieve the Schema corresponding to name.

public List<Schema>
getSchemas()

Implements com.mysql.cj.xdevapi.Session.getSchemas.

Retrieve the list of Schema objects for which the current user has access.

public MysqlxSession
public String
getUri()

Implements com.mysql.cj.xdevapi.Session.getUri.

Get the URL used to create this session.

public boolean
isOpen()

Implements com.mysql.cj.xdevapi.Session.isOpen.

Is this session open?

public void
releaseSavepoint(String
savepoint name
name
)

Implements com.mysql.cj.xdevapi.Session.releaseSavepoint.

Releases the named savepoint.

public void
rollback()

Implements com.mysql.cj.xdevapi.Session.rollback.

Rollback the transaction.

public void
rollbackTo(String
savepoint name
name
)

Implements com.mysql.cj.xdevapi.Session.rollbackTo.

Rolls back the transaction to the named savepoint.

public String
setSavepoint()

Implements com.mysql.cj.xdevapi.Session.setSavepoint.

Creates a transaction savepoint with an implementation-defined generated name and returns its name, which can be used in rollbackTo(String) or releaseSavepoint(String).

public String
setSavepoint(String
savepoint name
name
)

Implements com.mysql.cj.xdevapi.Session.setSavepoint.

Creates or replaces a transaction savepoint with the given name.

public SqlStatementImpl
sql(String
native SQL statement
sql
)

Implements com.mysql.cj.xdevapi.Session.sql.

Create a native SQL command.

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

defaultSchemaNameback to summary
protected String defaultSchemaName
sessionback to summary
protected MysqlxSession session
xbuilderback to summary
private XMessageBuilder xbuilder

Constructor Detail

SessionImplback to summary
public SessionImpl(HostInfo hostInfo)

Constructor.

Parameters
hostInfo:HostInfo

HostInfo instance

SessionImplback to summary
public SessionImpl(XProtocol prot)
SessionImplback to summary
protected SessionImpl()

Method Detail

closeback to summary
public void close()

Implements com.mysql.cj.xdevapi.Session.close.

Doc from com.mysql.cj.xdevapi.Session.close.

Close this session.

Annotations
@Override
commitback to summary
public void commit()

Implements com.mysql.cj.xdevapi.Session.commit.

Doc from com.mysql.cj.xdevapi.Session.commit.

Commit the transaction.

Annotations
@Override
createSchemaback to summary
public Schema createSchema(String schemaName)

Implements com.mysql.cj.xdevapi.Session.createSchema.

Doc from com.mysql.cj.xdevapi.Session.createSchema.

Create and return a new schema with the name given by name.

Parameters
schemaName:String

name of schema to create

Returns:Schema

Schema created

Annotations
@Override
createSchemaback to summary
public Schema createSchema(String schemaName, boolean reuseExistingObject)

Implements com.mysql.cj.xdevapi.Session.createSchema.

Doc from com.mysql.cj.xdevapi.Session.createSchema.

Create and return a new schema with the name given by name. If the schema already exists, a reference to it is returned.

Parameters
schemaName:String

name of schema to create

reuseExistingObject:boolean

true to reuse

Returns:Schema

Schema created

Annotations
@Override
dropSchemaback to summary
public void dropSchema(String schemaName)

Implements com.mysql.cj.xdevapi.Session.dropSchema.

Doc from com.mysql.cj.xdevapi.Session.dropSchema.

Drop the existing schema with the name given by name.

Parameters
schemaName:String

name of schema to drop

Annotations
@Override
getDefaultSchemaback to summary
public Schema getDefaultSchema()

Implements com.mysql.cj.xdevapi.Session.getDefaultSchema.

Doc from com.mysql.cj.xdevapi.Session.getDefaultSchema.

Retrieve the default schema name, which might have been configured at the time of connection. Returns null if no default schema has been set.

Returns:Schema

default Schema or null if no default schema has been set

Annotations
@Override
getDefaultSchemaNameback to summary
public String getDefaultSchemaName()

Implements com.mysql.cj.xdevapi.Session.getDefaultSchemaName.

Doc from com.mysql.cj.xdevapi.Session.getDefaultSchemaName.

Retrieve the default schema name, which might have been configured at the time of connection. Returns empty String if no default schema has been set.

Returns:String

default schema name or empty String if no default schema has been set

Annotations
@Override
getSchemaback to summary
public Schema getSchema(String schemaName)

Implements com.mysql.cj.xdevapi.Session.getSchema.

Doc from com.mysql.cj.xdevapi.Session.getSchema.

Retrieve the Schema corresponding to name.

Parameters
schemaName:String

name of schema to retrieve

Returns:Schema

Schema

Annotations
@Override
getSchemasback to summary
public List<Schema> getSchemas()

Implements com.mysql.cj.xdevapi.Session.getSchemas.

Doc from com.mysql.cj.xdevapi.Session.getSchemas.

Retrieve the list of Schema objects for which the current user has access.

Returns:List<Schema>

list of Schema objects

Annotations
@Override
getSessionback to summary
public MysqlxSession getSession()
getUriback to summary
public String getUri()

Implements com.mysql.cj.xdevapi.Session.getUri.

Doc from com.mysql.cj.xdevapi.Session.getUri.

Get the URL used to create this session.

Returns:String

URI

Annotations
@Override
isOpenback to summary
public boolean isOpen()

Implements com.mysql.cj.xdevapi.Session.isOpen.

Doc from com.mysql.cj.xdevapi.Session.isOpen.

Is this session open?

Returns:boolean

true if session is open

Annotations
@Override
releaseSavepointback to summary
public void releaseSavepoint(String name)

Implements com.mysql.cj.xdevapi.Session.releaseSavepoint.

Doc from com.mysql.cj.xdevapi.Session.releaseSavepoint.

Releases the named savepoint. This method will succeed as long as the given save point has not been already rolled back or released. Rolling back to a savepoint prior to the one named will release or rollback any that came after.

Parameters
name:String

savepoint name

Annotations
@Override
rollbackback to summary
public void rollback()

Implements com.mysql.cj.xdevapi.Session.rollback.

Doc from com.mysql.cj.xdevapi.Session.rollback.

Rollback the transaction.

Annotations
@Override
rollbackToback to summary
public void rollbackTo(String name)

Implements com.mysql.cj.xdevapi.Session.rollbackTo.

Doc from com.mysql.cj.xdevapi.Session.rollbackTo.

Rolls back the transaction to the named savepoint. This method will succeed as long as the given save point has not been already rolled back or released. Rolling back to a savepoint prior to the one named will release or rollback any that came after.

Parameters
name:String

savepoint name

Annotations
@Override
setSavepointback to summary
public String setSavepoint()

Implements com.mysql.cj.xdevapi.Session.setSavepoint.

Doc from com.mysql.cj.xdevapi.Session.setSavepoint.

Creates a transaction savepoint with an implementation-defined generated name and returns its name, which can be used in rollbackTo(String) or releaseSavepoint(String). Calling this method more than once should always work. The generated name shall be unique per session.

Returns:String

savepoint name

Annotations
@Override
setSavepointback to summary
public String setSavepoint(String name)

Implements com.mysql.cj.xdevapi.Session.setSavepoint.

Doc from com.mysql.cj.xdevapi.Session.setSavepoint.

Creates or replaces a transaction savepoint with the given name. Calling this method more than once should always work.

Parameters
name:String

savepoint name

Returns:String

savepoint name

Annotations
@Override
sqlback to summary
public SqlStatementImpl sql(String sql)

Implements com.mysql.cj.xdevapi.Session.sql.

Doc from com.mysql.cj.xdevapi.Session.sql.

Create a native SQL command. Placeholders are supported using the native "?" syntax.

Parameters
sql:String

native SQL statement

Returns:SqlStatementImpl

SqlStatement

Annotations
@Override
startTransactionback to summary
public void startTransaction()

Implements com.mysql.cj.xdevapi.Session.startTransaction.

Doc from com.mysql.cj.xdevapi.Session.startTransaction.

Start a new transaction.

Annotations
@Override