# Poco::Data::MySQL

# class SessionImpl

Library: Data/MySQL
Package: MySQL
Header: Poco/Data/MySQL/SessionImpl.h

## Description

Implements SessionImpl interface

## Inheritance

Direct Base Classes: Poco::Data::AbstractSessionImpl < SessionImpl >

All Base Classes: Poco::Data::AbstractSessionImpl < SessionImpl >

## Member Summary

Member Functions: begin, close, commit, createStatementImpl, getInsertId, isConnected, isTransaction, rollback, setInsertId

## Constructors

### SessionImpl

SessionImpl(
const std::string & connectionString
);

Creates the SessionImpl. Opens a connection to the database

Connection string format:

    <str> == <assignment> | <assignment> ';' <str>
    <assignment> == <name> '=' <value>
    <name> == 'host' | 'port' | 'user' | 'password' | 'db' } 'compress' | 'auto-reconnect'
    <value> == [~;]*

for compress and auto-reconnect correct values are true/false for port - numeric in decimal notation

## Destructor

### ~SessionImpl

~SessionImpl();

Destroys the SessionImpl.

## Member Functions

### begin

virtual void begin();

Starts a transaction

### close

virtual void close();

Closes the connection

### commit

virtual void commit();

Commits and ends a transaction

### createStatementImpl

virtual Poco::Data::StatementImpl * createStatementImpl();

Returns an MySQL StatementImpl

### getInsertId

Poco::Any getInsertId(
const std::string & param13
);

Get insert id

### isConnected

virtual bool isConnected();

Returns true if and only if session is connected.

### isTransaction

virtual bool isTransaction();

Returns true if and only if a transaction is in progress.

### rollback

virtual void rollback();

Aborts a transaction

### setInsertId

void setInsertId(
const std::string & param11,
const Poco::Any & param12
);

Try to set insert id - do nothing.