# Poco::Data::MySQL

# class SessionHandle

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

## Description

MySQL session handle

## Member Summary

Member Functions: autoCommit, close, commit, connect, init, operator =, operator MYSQL *, options, ping, reset, rollback, startTransaction

## Constructors

### SessionHandle

explicit SessionHandle(
MYSQL * mysql
);

Creates session handle

### SessionHandle

SessionHandle(
const SessionHandle & param17
) = delete;

## Destructor

### ~SessionHandle

~SessionHandle();

Destroy handle, close connection

## Member Functions

### autoCommit

void autoCommit(
bool val
);

Set autocommit mode

### close

void close();

Close connection

### commit

void commit();

Commit transaction

### connect

void connect(
const char * host,
const char * user,
const char * password,
const char * db,
unsigned int port
);

Connect to server

### init

void init(
MYSQL * mysql = nullptr
);

Initializes the handle if and only if not initialized.

### operator =

SessionHandle & operator = (
const SessionHandle & param18
) = delete;

### operator MYSQL *

operator MYSQL * ();

### options

void options(
mysql_option opt
);

Set connection options

### options

void options(
mysql_option opt,
bool b
);

Set connection options

### options

void options(
mysql_option opt,
const char * c
);

Set connection options

### options

void options(
mysql_option opt,
unsigned int i
);

Set connection options

### ping

bool ping();

Checks if the connection is alive.

### reset

void reset();

Reset connection with dababase and clears session state, but without disconnecting

### rollback

void rollback();

Rollback transaction

### startTransaction

void startTransaction();

Start transaction