Example usage for io.vertx.mysqlclient MySQLConnectOptions setCharset

List of usage examples for io.vertx.mysqlclient MySQLConnectOptions setCharset

Introduction

In this page you can find the example usage for io.vertx.mysqlclient MySQLConnectOptions setCharset.

Prototype

public MySQLConnectOptions setCharset(String charset) 

Source Link

Document

Set the charset for the connection.

Usage

From source file:examples.MySQLClientExamples.java

public void configureConnectionCharset() {
    MySQLConnectOptions connectOptions = new MySQLConnectOptions();

    // set connection character set to utf8 instead of the default charset utf8mb4
    connectOptions.setCharset("utf8");
}

From source file:examples.MySQLClientExamples.java

public void configureConnectionCollation() {
    MySQLConnectOptions connectOptions = new MySQLConnectOptions();

    // set connection collation to utf8_general_ci instead of the default collation utf8mb4_general_ci
    // setting a collation will override the charset option
    connectOptions.setCharset("gbk");
    connectOptions.setCollation("utf8_general_ci");
}