public static CommandExecutor newInstance(final MySQLCommandPacketType commandPacketType, final CommandPacket commandPacket, final BackendConnection backendConnection) {
        log.debug("Execute packet type: {}, value: {}", commandPacketType, commandPacket);
        switch (commandPacketType) {
            case COM_QUIT:
                return new MySQLComQuitExecutor();
            case COM_INIT_DB:
                return new MySQLComInitDbExecutor((MySQLComInitDbPacket) commandPacket, backendConnection);
            case COM_FIELD_LIST:
                return new MySQLComFieldListPacketExecutor((MySQLComFieldListPacket) commandPacket, backendConnection);
            case COM_QUERY:
                return new MySQLComQueryPacketExecutor((MySQLComQueryPacket) commandPacket, backendConnection);
            case COM_STMT_PREPARE:
                return new MySQLComStmtPrepareExecutor((MySQLComStmtPreparePacket) commandPacket, backendConnection);
            case COM_STMT_EXECUTE:
                return new MySQLComStmtExecuteExecutor((MySQLComStmtExecutePacket) commandPacket, backendConnection);
            case COM_STMT_CLOSE:
                return new MySQLComStmtCloseExecutor((MySQLComStmtClosePacket) commandPacket);
            case COM_PING:
                return new MySQLComPingExecutor();
            default:
                return new MySQLUnsupportedCommandExecutor(commandPacketType);
        }
    }
public static CommandExecutor newInstance ( final MySQLCommandPacketType commandPacketType , final CommandPacket commandPacket , final BackendConnection backendConnection ) { log . debug ( "Execute packet type: {}, value: {}" , commandPacketType , commandPacket ) ; switch ( commandPacketType ) { case COM_QUIT : return new MySQLComQuitExecutor ( ) ; case COM_INIT_DB : return new MySQLComInitDbExecutor ( ( MySQLComInitDbPacket ) commandPacket , backendConnection ) ; case COM_FIELD_LIST : return new MySQLComFieldListPacketExecutor ( ( MySQLComFieldListPacket ) commandPacket , backendConnection ) ; case COM_QUERY : return new MySQLComQueryPacketExecutor ( ( MySQLComQueryPacket ) commandPacket , backendConnection ) ; case COM_STMT_PREPARE : return new MySQLComStmtPrepareExecutor ( ( MySQLComStmtPreparePacket ) commandPacket , backendConnection ) ; case COM_STMT_EXECUTE : return new MySQLComStmtExecuteExecutor ( ( MySQLComStmtExecutePacket ) commandPacket , backendConnection ) ; case COM_STMT_CLOSE : return new MySQLComStmtCloseExecutor ( ( MySQLComStmtClosePacket ) commandPacket ) ; case COM_PING : return new MySQLComPingExecutor ( ) ; default : return new MySQLUnsupportedCommandExecutor ( commandPacketType ) ; } }
Create new instance of packet executor.

@param commandPacketType command packet type for MySQL
@param commandPacket command packet for MySQL
@param backendConnection backend connection
@return command executor