Search in sources :

Example 1 with MysqlxSession

use of com.mysql.cj.MysqlxSession in project aws-mysql-jdbc by awslabs.

the class DevApiBaseTestCase method sqlUpdate.

protected void sqlUpdate(String sql) {
    try {
        Field f = SessionImpl.class.getDeclaredField("session");
        f.setAccessible(true);
        MysqlxSession mysqlxSession = (MysqlxSession) f.get(this.session);
        mysqlxSession.query(mysqlxSession.getMessageBuilder().buildSqlStatement(sql), new UpdateResultBuilder<>());
    } catch (Exception e) {
        e.printStackTrace();
        throw new RuntimeException(e);
    }
}
Also used : Field(java.lang.reflect.Field) MysqlxSession(com.mysql.cj.MysqlxSession) UnknownHostException(java.net.UnknownHostException) SQLException(java.sql.SQLException)

Example 2 with MysqlxSession

use of com.mysql.cj.MysqlxSession in project aws-mysql-jdbc by awslabs.

the class InternalXBaseTestCase method createTestSession.

public MysqlxSession createTestSession() {
    PropertySet pset = new DefaultPropertySet();
    pset.initializeProperties(this.testProperties);
    MysqlxSession session = new MysqlxSession(this.testHostInfo, pset);
    return session;
}
Also used : DefaultPropertySet(com.mysql.cj.conf.DefaultPropertySet) PropertySet(com.mysql.cj.conf.PropertySet) DefaultPropertySet(com.mysql.cj.conf.DefaultPropertySet) MysqlxSession(com.mysql.cj.MysqlxSession)

Aggregations

MysqlxSession (com.mysql.cj.MysqlxSession)2 DefaultPropertySet (com.mysql.cj.conf.DefaultPropertySet)1 PropertySet (com.mysql.cj.conf.PropertySet)1 Field (java.lang.reflect.Field)1 UnknownHostException (java.net.UnknownHostException)1 SQLException (java.sql.SQLException)1